I want to set up mod_rewrite to work with apache. So I installed apache on my box. Since these days apache comes with mod_rewrite installed by default, I thought I would not have to make any changes to apache to get it working, but for some reason mod_rewrite is not working. My apache version is "Apache version 2.0.59" 1. I have the following lines present my httpd.conf LoadModule rewrite_module modules/mod_rewrite.so Code (markup): 2. modules/mod_rewrite.so is available on my system. 3. To test mod rewrite I created a .htacces file under /var/www/html/test/ with the following lines RewriteEngine On RewriteRule ^check\.php$ /phpinfo.php [L] Code (markup): I have the file /var/www/html/phpinfo.php present. Now trying to access the page at www.shabda.name/test/check.php gives a 404 error while www.shabda.name/phpinfo.php gets me the required page. So mod_rewrite is not working. Hrrmff!
Options +FollowSymLinks +Indexes RewriteEngine on RewriteBase / RewriteRule ^test/check\.php$ phpinfo.php [L] domain.com/.htaccess http://www.shabda.name/test/phpinfo.php is dead there for it can't work since you have .htaccess stuck in the test directory and that file isn't in that directory.
Hi Nintendo. Thanks a ton for trying to help me. I modified my /var/www/html/.htaccess file to the one you recommended. I created a new file so that http://www.shabda.name/test/phpinfo.php is accesible. But even then I cant get mod_reqrite to work. Any way this is not the rule I want to write. I am trying to set up WPMU and that has a given .htaccess file. So I am pretty sure that rules files is correct. My guess is that for some reason mod_rewrite is not being picked up by apache. Do we need to do anythin apart from the lines LoadModule rewrite_module modules/mod_rewrite.so to enable mod_rewrite?
My problem is solved. The problem was that in my httpd.conf I had made the changes <Directory /> Options FollowSymLinks Indexes AllowOverride FileInfo Options </Directory> Code (markup): But later in the httpd.conf I had given the configuration option as <directory "/var/www/html"> .... AllowOverride None Code (markup): Changed to allowoverride all, and its all working.
Hey guys, I'll post on here so I don't have to create a seperate thread I also have a problem, a client I am working for has his domain hosted externally and is using the cpannel x stuff to moderate it. I have FTP access but not to the actual server. I understand that I can use mod_rewrite through the .htaccess file (which I can access) but I am not wanting to "neaten" a URL but to redirect anyone linking to/typing in caps in the path of the URL i.e mydomain.com/PaGe1.html to be rewritten to mydomain.com/page1.html Obviously it's on apache and the case issue is casuing us some errors. Any help would be nice I am a bit n00b at this coding stuff.
Is that the line I need in my htaccess Nintendo? Thanks BTW Hmm i looked into it a little more and tried adding the line but it creates a 500 error, is it possible it's not installed on the server (remembering I don't have te actual server only the crappy control panel thing) [edit] OK I have tried a few things I have read up on and neither seem to work. Placing just "CheckSpelling on" gives my whole site a 500 Using <IfModule mod_speling.c> CheckSpelling On </IfModule> results in all mispellings/case errors to remain as 404 and go to my (custom) 404 page What am I missing to activate the function correctly?
That's all I got for it to work on mine. For examples on what it does... http://www.public-domain-content.com/INDEX.shtml redirected to normal url. http://www.public-domain-content.com/IN7DEX.shtml redirected to normal url. http://www.public-domain-content.com/INDEX.shtml666 Page showing a link to the correct URL. http://www.public-domain-content.com/index.html redirected to normal url.
Yeah thats exactly what I wanted, hmmm thanks for the help anyway Nintendo, I am sure its something stupid server side.