Forum Moderators: phranque
Here are the details. We are using Apache 2.0.50
on Redhat Linux. In httpd.conf we have:
DirectoryIndex index.html index.htm ...
AccessFileName .htaccess
<Directory "/var/docroot/testdir">
AllowOverride All
</Directory>
<VirtualHost *:80>
ServerName myservername.com
DocumentRoot /var/docroot
...
</VirtualHost>
In /var/docroot/testdir we have index.html,
.htaccess and test.html.
In .htaccess we have:
Options FollowSymLinks
RewriteEngine on
RewriteRule ^index\.html /testdir/test.html [R,L]
Without the rewrite rule, the URI
[myservername.com...] should process
index.html; with the rewrite rule it should process
test.html. This is how it works on our older
server using Apache 1.3.27. However, on our new
server with Apache 2.0.50 it ignores the rewrite
rule and processes index.html. Yet the URI
[myservername.com...] does
observe the rule and processes test.html while
replacing the displayed URI with
[myservername.com...]
Notes:
- The .htaccess file is being read - I have put
other commands in there and they are processed.
- The following do work in the .htaccess file:
"Redirect /testdir/index.html
[myservername.com...]
and
"DirectoryIndex /testdir/test.html index.html"
but we want to be able to use relative paths
and have the updated URI displayed.
- This problem applies to all directories where
we use an .htaccess file with RewriteRule for
index.html.
Altenately, you can modify the rule:
RewriteRule ^(index\.html)?$ /testdir/test.html [L]
Jim