Forum Moderators: phranque

Message Too Old, No Replies

Redirect folder to script page using .htaccess

         

war_veteran

6:45 pm on Oct 11, 2007 (gmt 0)

10+ Year Member



Hi Guys,

I was hoping to achieve this using .htaccess:

When user accesses this:

[mydomain.com...]

he will be redirected to this:

[mydomain.com...]

TIA

g1smd

11:50 pm on Oct 11, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



i am guessing you don't want a redirect, but instead need a rewite.

If so, there are several threads open with postings from the last couple of days that cover the answer.

Post the code that you are trying out.

war_veteran

12:46 am on Oct 12, 2007 (gmt 0)

10+ Year Member



Forgive my mistake. Yeah, it's a rewrite I guess.

My .htaccess file looks like this:

AddHandler x-httpd-php5 .phpRewriteCond %{HTTP_REFERER}!^http://mydomain.com/.*$ [NC]

RewriteRule .*\.(jpg¦jpeg¦gif¦png¦bmp)$ - [F,NC]
RewriteRule ^([a-z0-9_-]+)(/(index\.php)?)?$ /viewpage.php?id=$1 [NC,QSA,L]

war_veteran

8:29 pm on Oct 13, 2007 (gmt 0)

10+ Year Member



Anyone...?

jdMorgan

8:40 pm on Oct 13, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



This forum cannot function as a free code-writing service; questions are too many and contributors too few. Please review our forum charter on how to get the most out of this forum.

This .htaccess rule, modified from one discussed just this week, should get you started:


RewriteRule ^([0-9]+)$ /pageview.php?dbid=$1 [L]

For more information, see the documents cited in our forum charter [webmasterworld.com] and the tutorials in the Apache forum section of the WebmasterWorld library [webmasterworld.com].

Jim