pixeltrace Posted May 24, 2007 Share Posted May 24, 2007 Hi, Apache user newbie here. I need help, how do i enable mod_rewrite in my apache? what are the codes or lines that i should have in my httpd.conf file? also, what are the other files that i need to modify and things, testing to do to make it and know that its already working? hope you could help me with this. thanks so much!!!! Quote Link to comment https://forums.phpfreaks.com/topic/52834-help-on-enabling-mod_rewrite-in-apache/ Share on other sites More sharing options...
wildteen88 Posted May 24, 2007 Share Posted May 24, 2007 to enable mod_rewrite edit the the httpd.conf file and find this line: #LoadModule rewrite_module modules/mod_rewrite.so Change it to this: LoadModule rewrite_module modules/mod_rewrite.so Also scroll down to around line 200 and make sure AllowOverride directive has FileInfo listed. Save the httpd.conf file and restart Apache. mod_rewrite should now be available Quote Link to comment https://forums.phpfreaks.com/topic/52834-help-on-enabling-mod_rewrite-in-apache/#findComment-260901 Share on other sites More sharing options...
pixeltrace Posted May 24, 2007 Author Share Posted May 24, 2007 thanks! how will i restart the apache? what is the command? thanks! Quote Link to comment https://forums.phpfreaks.com/topic/52834-help-on-enabling-mod_rewrite-in-apache/#findComment-260904 Share on other sites More sharing options...
wildteen88 Posted May 24, 2007 Share Posted May 24, 2007 What OS are you using? Windows Mac/Linux. If its Windows just right click the Apache task bar icon and click restart from the context menu. If your new configuration works it should restart with no errors/error sounds during restart. For restarting Apache under Mac/Linux please read this page of the Apache Manual. To test mod_rewrite works just create a simple test file, call it modTest.html and put some random stuff in there. Then create a new fill called ".htaccess" (minus the quotes). Then add this in it: RewriteEngine On RewriteRule ^mod_rewrite_test/$ modTest.html Place that file in that same directory as modTest.html now go to http://my-domain.com/mod_rewrite_test/ It should now show the contents of modTest.html Quote Link to comment https://forums.phpfreaks.com/topic/52834-help-on-enabling-mod_rewrite-in-apache/#findComment-260925 Share on other sites More sharing options...
pixeltrace Posted May 25, 2007 Author Share Posted May 25, 2007 Hi i am using linux. also i went to my httpd.conf file the configuration says that its something like vhost. also i cannot find this line #LoadModule rewrite_module modules/mod_rewrite.so and this line also AllowOverride if thats the case should i just add this LoadModule rewrite_module modules/mod_rewrite.so and this AllowOverride help on this please. thanks! Quote Link to comment https://forums.phpfreaks.com/topic/52834-help-on-enabling-mod_rewrite-in-apache/#findComment-261261 Share on other sites More sharing options...
wildteen88 Posted May 25, 2007 Share Posted May 25, 2007 Where are you editing the httpd.conf from? I am not familiar with installing Apache on linux based systems. Quote Link to comment https://forums.phpfreaks.com/topic/52834-help-on-enabling-mod_rewrite-in-apache/#findComment-261785 Share on other sites More sharing options...
steviewdr Posted May 28, 2007 Share Posted May 28, 2007 Apache on linux does things much more on a modular basis. All available modules (ssl, mod_rewrite) etc. are stored in: /etc/apache2/mods-available all enabled apache modules are linked from above and placed in: /etc/apache2/mods-enabled To enable a module, simply type (in a shell terminal): a2enmod and select your module from the list. To restart apache on linux: /etc/init.d/apache2 restart Take a read of http://wiki.kartbuilding.net/index.php/Apache_2_%26_SSL_-_PHP4_-_MySQL_4.1 If you are having problems with the above, you will need to supply your linux os, whether its ubuntu, fedora etc. -steve Quote Link to comment https://forums.phpfreaks.com/topic/52834-help-on-enabling-mod_rewrite-in-apache/#findComment-263127 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.