943,879 Members | Top Members by Rank

Nov 19th, 2008
0

Mod_Rewrite Problem

Expand Post »
Hello,
I am currently having a problem with .htaccess. I am trying to use mod_rewrite to rewrite: http://www.example.com/test/test?word=test to http://www.example.com/test/test.php?word=test. The only problem is the GET vars can have different names. So another example url could be http://www.example.com/test/test?test=true&form=1 or even http://www.example.com/test/test?search=Google&type=Web etc. For this I wrote a simple PHP script called test.php that simply uses foreach to write all the GET variables to the screen. Then I used this .htaccess file to do the rewriting:
RewriteEngine on
RewriteRule ^test/?([.])?$ test.php/?$1 [L]
It should rewrite test?some+vars+here to test.php?some+vars+here but for some reason it doesn't. The test page is diplaying perfectly, but for some reason mod_rewrite won't rewrite the GET vars in. I am using Apache 2.2. Can some mod_rewrite expert help me. This is urgent!!!!
Thanks so Much!!!
FlashCreations
Last edited by FlashCreations; Nov 19th, 2008 at 7:09 pm.
Similar Threads
Reputation Points: 47
Solved Threads: 47
Posting Whiz
FlashCreations is offline Offline
393 posts
since Sep 2008
Nov 23rd, 2008
0

Re: Mod_Rewrite Problem

Hi Everyone,
I fixed the problem. It was simply I didn't have mod_rewrite enabled. Something that simple should have been checked earlier, but I am know for these mistakes!
Reputation Points: 47
Solved Threads: 47
Posting Whiz
FlashCreations is offline Offline
393 posts
since Sep 2008

This thread is solved

Either the thread starter or a moderator has marked this thread as solved. You can most likely trust the responses and answers given. There is most likely no reason for any further responses to be posted here. If you have a related question, please start a new thread in this forum instead.

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in Linux Servers and Apache Forum Timeline: Organized Distribution
Next Thread in Linux Servers and Apache Forum Timeline: The Land of Corn, Wheat, and Data Centers





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC