Jump to content

[SOLVED] configure apache for mod rewrite


B34ST

Recommended Posts

hi i recently found that i can use mod rewrite on my paid domain simply by editing the .htaccess and can get this to work but i have a problem when it comes to using it on my localhost I have tried to do the following:

 

uncomment the line LoadModule rewrite_module modules/mod_rewrite.so in httpd.conf

 

then adding a new .htaccess file in a test folder with a test script that has a $_GET function in the .htaccess file i added:

 

RewriteEngine On

RewriteRule ^r/([^/]*)\.html$ /test/test.php?r=$1 [L]

 

therefore if i goto http://localhost/r/true.html it should be the same as http://localhost/test/test.php?r=true but instead i get 404:not found

 

I read somewhere that i should also make sure the line ClearModuleList is uncommented then find and make sure that the line AddModule mod_rewrite.c is not commented out. but i do not seem to have these lines in my httpd.conf file.

 

Can anyone help me to get this to work?

Link to comment
https://forums.phpfreaks.com/topic/55343-solved-configure-apache-for-mod-rewrite/
Share on other sites

I have just found the answer. Here it is for anyone that is interested:

 

aswell as what I have explained above I had to find the line:

 

AllowOverride None

 

and change it to:

 

AllowOverride ALL

 

now mod_rewrite works fine.

 

Thanks for your time anyway

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.