Forum Moderators: phranque

Message Too Old, No Replies

Rewritten index page: don't have permission

Certain types of rewritten index page work not others

         

slowby

3:15 pm on May 3, 2006 (gmt 0)

10+ Year Member



Very thankful for any help. Suspicions will be that this is a Tomcat question but I don't think so! Apache 1.3.33

I have a Directory set up like:


DocumentRoot "/Library/Tomcat/webapps/villas"
DirectoryIndex "index.htm"
<Directory "/Library/Tomcat/webapps/villas">
Options All -Indexes +ExecCGI +MultiViews
Allow from all
AllowOverride None
Order allow,deny
</Directory>
<IfModule mod_rewrite.c>
RewriteEngine On


#These work
#RewriteRule ^/index.htm$ /bla.htm [L,PT]
RewriteRule ^/bla2.htm$ /bla.htm [L,PT]
RewriteRule ^/bla3.htm$ /sv/main?temp=short_list [L,PT]
#This doesn't work
RewriteRule ^/index.htm$ /sv/main?temp=short_list [L,PT]
RewriteLog /var/log/httpd/rewrite1.log
RewriteLogLevel 9
RewriteCond %{REQUEST_METHOD} ^TRACE
RewriteRule .* - [F]
</IfModule>

What happens is that the first three work as expected, but the fourth does not: it gets 403 forbidden : the rewrite log says that the rewrite has happened, and if I directly hit the url that I am rewriting to then of course it works - so it seems that what I am rewriting to some how makes it 403, but it's not, because I can hit that URL directly. The third and fourth are pointing to servlets in Tomcat, but I don't think that can be relevant because I get Apache error log: Directory Index forbidden by rule and nothing in Tomcat access log. I'm very confused. Please help.

PS: Of course if I hit the index like [blabla...] then it works: it's just using it as [blabla...] that doesn't

slowby

3:51 pm on May 4, 2006 (gmt 0)

10+ Year Member



OK I worked it out with a little help. What I was trying to do was set the DirectoryIndex and then redirect that index to what I wanted. Actually I just needed to redirect /, which has the same effect as setting the DirectoryIndex. I don't know why I was trying to it that way except that it has worked for me before. The 403 was not really a 403. It was just a sign that something was wrong. Never believe a 403 if it doesn't make sense.