Forum Moderators: phranque

Message Too Old, No Replies

little problem big troubles mod_rewrite

         

jacqueschoquette

3:06 pm on Nov 28, 2004 (gmt 0)

10+ Year Member



After 3 solid days i have managed to get apache with mod_rewrite installed with php.

Not bad for a coldfusion / iis guy

However i am having problems getting a mod_rewrite rule to work

I know it is working because this simple rule processes no problem

RewriteRule ^foo.html bar.html [R,L]

however when i try to rewrite the folloing url

[localhost...]

to output as

[localhost...]

I have no luck page not found?

I have tried to following combinations with no success

RewriteRule ^playhere/(.*)/(.*)/$ playhere.php?$1=$2
RewriteRule /playhere/(.*)/(.*)/$ /playhere.php?$1=$2
RewriteRule playhere/(.*)/(.*)/$ /playhere.php?$1=$2

also do you need to restart apache after modifing the .htaccess file?

Any help with this issue would be of great assistance and be much appreciated

thank you in advance

jdMorgan

4:26 pm on Nov 28, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Jacques,

Bienvenue a WebmasterWorld!

> also do you need to restart apache after modifing the .htaccess file?

No, .htaccess rules are processed for each request. It is not necessary to restart Apache if you change .htaccess files, as it would be if you changed httpd.conf.

For more information about rewriting the URLs, see the second post in this recent thread [webmasterworld.com]. The information in the second and fifth paragraphs may help clarify your problem.

Jim

jdMorgan

4:46 pm on Nov 28, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



If you are trying to rewrite a static URL requested by a browser to a dynamic one to pass to your script, something like this should work better:

RewriteRule ^([^/]+)/([^/]+)/([^.]+)\.html$ /$1.php?$2=$3 [L]

Jim