i have an off-line development machine running redhat8.0/apache2.0. i use this machine to develop cgi scripts, mainly using tcl.
i have been trying to do some url rewriting using mod_rewrite and as suggested in earlier posts i have tried the simplest rewrite from sillyfile.html to index.html but i am getting the following error in my error log:
[Tue Apr 08 21:28:24 2003] [error] [client 66.87.12.73] File does not exist: /var/www/html/develop/sillyfile.html
i have checked my httpd.conf file which shows a line loading the mod_rewrite module and this module does exist
my .htaccess file contains:
RewriteEngine on
RewriteBase /
RewriteRule ^sillyfile\.html$ /index.html [L]
i have verified my .htaccess file by trying it out on a temporary domain name on my live webserver and it rewrites just fine. i would prefer not to develop scripts on my live webserver.
i wonder if anyone could advise me on what to try next? i'm quickly running out of ideas.
thanks in advance
In the directory block that sets up your DocumentRoot, e.g.
#
# This should be changed to whatever you set DocumentRoot to.
#
<Directory "C:\FoxServ\www">#more stuff
</Directory>
1) Comment out the current "options" such as Indexes and Followsymlinks and instread use
Options Indexes FollowSymLinks MultiViews ExecCGI
I read in another forum that this should be all on one line even though the default config puts it on multiple.
2) change "AllowOverride None" to "AllowOverride All"
Good luck, last year mod_rewrite was second only to Overture editors for loss of my hair.
As long as .htaccess and index.html exist in the directory where you are testing, this should work.
It is often necessary to add
Options +FollowSymLinks
ahead of the RewriteEngine on directive, but in cases where this is necessary, you'll get a 500 server error telling you that you need to enable SymLinks.
If your .htaccess is above the directory where you wish to access sillyfile.html, then do not use a start anchor (^) on the pattern, i.e., use
RewriteRule sillyfile\.html$ /index.html [L]
or include the subdirectory path in the pattern, i.e.
RewriteRule ^subdir/sillyfile\.html$ /index.html [L]
Jim