Forum Moderators: phranque
Options +FollowSymLinks
rewriteEngine on
rewriteRule ^widgets\.shtml$ /cgi-bin/perlfect/search/search.pl?&q=widgets [R=301,L]
This gives me a internal server error(500) when requesting any page on the site.
It also gives me the following in my error.log file.
/home/widgets/htdocs/.htaccess: Invalid command 'rewriteRule', perhaps mis-spelled or defined by a module not included in the server configuration
/home/widgets/htdocs/.htaccess: Invalid command 'rewriteEngine', perhaps mis-spelled or defined by a module not included in the server configuration
Does this mean that Rewrite is not installed on my server or it there something wrong with my code? Is there any other way to get the same effect if it is my server?
Thanks for any help
If it's your server, open the httpd.conf file and look for these lines:
#LoadModule rewrite_module modules/mod_rewrite.so
#AddModule mod_rewrite.c
If you see them, simply remove the # from the beginning and then save the file. If you don't see them, put them in there, without the #, of course.
You will need to restart Apache for the change to take place.
Disclaimer Back the file up beforehand, just in case. I'm not the Apache guru.
Welcome to WebmasterWorld [webmasterworld.com]!
Try the Redirect and RedirectMatch directives of Apache mod_alias [httpd.apache.org].
Jim