Forum Moderators: phranque
I installed a package called AppServ 2.1.0, which includes apache 1.3.27, php 4.3.3RC1, and mysql 4.0.13.
It works perfectly for everything I've done with it so far. I just can't get it to work for any mod_rewrite stuff.
Here's the simple test I'm trying to get working now:
I want old.html to redirect to new.html so I put a .htaccess file in the dir that contains old.html and new.html which says:
RewriteEngine On
RewriteRule ^old\.html$ new.html
without changing anything else, when I load old.html, it gives me old.html instead of new.html.
the default of AllowOverride, however is None, which should cause that problem. But when I change it to All, I get a 500 server error. I've tried changing a million other things to no avail. And now I reinstalled AppServ so it's all fresh and default and tried it again. But it's the same thing!
What's going on here?!
let me know if you'd like me to post any parts of my files such as httpd.conf or whatever
Set AllowOverride FileInfo Options at a minumum.
Then in your .htaccess file, add Options +FollowSymLinks (You could also put this in httpd.conf).
Whenever you have a problem, examine your server error log file. In this case, it probably would have indicated the need for FollowSymLinks, which is needed to enable mod_rewrite.
Jim
:o ... If you are getting a 500-Server Error and there is nothing in your error, log, then that's the first thing that needs attention...
Check your LogLevel setting, and make sure it's set at error or warn for now.
If it's already set to one of those, or is missing (Apache defaults to warn) then there's something wrong beyond mod_rewrite not working. Maybe it's not compiled-in or loaded.
Jim
as far as mod_rewrite not being "compiled in or loaded", I'm not quite sure what you mean, but did change
#LoadModule rewrite_module modules/mod_rewrite.so
to
LoadModule rewrite_module modules/mod_rewrite.so
before posting this thread
If you haven't already looked at manual for rewriting this should help:
[httpd.apache.org...]
Cannot remove module mod_rewrite.c: not found in module list
also, I don't think the problem is with my .htaccess file because everytime I change
#
# This controls which options the .htaccess files in directories can
# override. Can also be "All", or any combination of "Options", "FileInfo",
# "AuthConfig", and "Limit"
#
AllowOverride None
to anything besides None, I get a 500 internal server error
Maybe there is something particular to your hosting system. Does your web hosting company have a forum? If not, contact them if there is anything about .htaccess that you should know because the script works on other systems.
Some web hosting companies don't like to provide technical support, but in this case you need to know if there is anything about the system that is being overlooked.