Forum Moderators: phranque

Message Too Old, No Replies

URL Rewrite Error

URL Rewrite Not Working

         

rajanr

7:23 pm on Aug 24, 2005 (gmt 0)

10+ Year Member



I have enabled mod_rewrite in my httpd.conf. I am running Apache 2.0.4 web server

This is what i have got as RewriteRules.
RewriteRule /brand\.html /meds.php?id=&srch=21
RewriteRule /product_1\.html
/meds.php?id=&srch=24
RewriteRule /product_2\.html
/meds.php?id=&srch=25
RewriteRule /product_3\.html
/meds.php?id=&srch=26
RewriteRule /product_4\.html
/meds.php?id=&srch=44
RewriteRule /product_5\.html
/meds.php?id=&srch=57

And my Rewrite Logs have some thing like this

72.25.105.128 - - [24/Aug/2005:09:12:19 --0700]
[www.example.com/sid#89dd0c0][rid#8babd58/initial] (2) init
rewrite engine with requested uri /brand.html
72.25.105.128 - - [24/Aug/2005:09:12:19 --0700]
[www.example.com/sid#89dd0c0][rid#8babd58/initial] (3) applying
pattern '/foo.html' to uri '/brand.html'
72.25.105.128 - - [24/Aug/2005:09:12:19 --0700]
[www.example.com/sid#89dd0c0][rid#8babd58/initial] (3) applying
pattern '/brand.html' to uri '/brand.html'
72.25.105.128 - - [24/Aug/2005:09:12:19 --0700]
[www.example.com/sid#89dd0c0][rid#8babd58/initial] (2) rewrite
/brand.html -> /meds.php?id=&srch=21
72.25.105.128 - - [24/Aug/2005:09:12:19 --0700]
[www.example.com/sid#89dd0c0][rid#8babd58/initial] (3) split
uri=/meds.php?id=&srch=21 -> uri=/meds.php, args=id=&srch=21
72.25.105.128 - - [24/Aug/2005:09:12:19 --0700]

[edited by: jdMorgan at 9:21 pm (utc) on Aug. 25, 2005]
[edit reason] Obscured specifics per TOS. [/edit]

rajanr

7:28 pm on Aug 24, 2005 (gmt 0)

10+ Year Member



I forgot to mention the problem i am facing.

My mod_rewrite is not working.

IF I use a simple rule like it works fine.

RewriteRule /foo\.html /bar.html

But when itry passing /zenegra\.html /meds.php?id=&srch=22
It won't convert the URL properly. Can someone have any alternative to rewrite this URL in that it works? I appreciate all for taking time to look into this.

jdMorgan

9:36 pm on Aug 24, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



rajanr,

Welcome to WebmasterWorld!

It's not clear why this is failing. Please post the rule that fails, the requested URL, and the URL that results from the rewrite. If your error log has any entries in it as a result of the test, then post that, too.

Rather than testing many new rules, it's often easier to test them one at a time. You can comment-out all rules except the one you are testing by adding a "#" character in front of it.

Jim

rajanr

3:25 pm on Aug 25, 2005 (gmt 0)

10+ Year Member



hi guys some how it started working again. Thanks for all your help