httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Don O'Neil" <li...@lizardhill.com>
Subject RE: [users@httpd] Strange httpd 2.4.6 Mod_Rewrite issue
Date Sun, 18 Aug 2013 14:55:36 GMT
Ok... here's some more detail on the issue.... The particular VHOST config
has 3 aliases... and when there are rewrite rules for just one alias it
seems to work fine... but as soon as there are 3, and in a particular order
I might add, then it breaks... and you get the error I posted on the last
rewrite rule, and error 500's on the other 2.... when I moved around the
order (a simple yank/put in VIM) then it started working.

Seems like I might have uncovered a bug here in the mod_rewrite module.

-----Original Message-----
From: Don O'Neil [mailto:lists@lizardhill.com] 
Sent: Saturday, August 17, 2013 8:28 AM
To: users@httpd.apache.org
Subject: [users@httpd] Strange httpd 2.4.6 Mod_Rewrite issue

I'm having a very strange issue with the mod_rewrite module.

First off here's the basics:

Apache 2.4.6, Centos 6 x64

Here's the loading of the directive:

<IfModule mod_rewrite.c>
        RewriteEngine on
        RewriteCond %{REQUEST_METHOD} ^(TRACE|TRACK)
        RewriteRule .* - [F]
        LogLevel alert rewrite:trace1
</IfModule>

The newdomain.com (example!!) address is set up as an alias on the main
vhost, and here's the rewrite in the .htaccess at the top level:

RewriteCond %{HTTP_HOST} ^((.+)\.newdomain|newdomain)\.com$
RewriteCond %{REQUEST_URI} !^(/cgi-bin/(.+)|/ newdomain |/ newdomain /(.*))$
RewriteRule ^(.*) newdomain /$1 [L]

This used to work on my old Apache 1.X box, but now it doesn't work on the
new one. when you go to the the alias, you get an error:

The requested URL /newdomain/index.htm was not found on this server.

Now it is true that there isn't an index.htm file in there, but there is an
index.shtml file... I've also tried it with an index.html file, index.php,
and even a symlink, but in all instances I get the same error. It's like the
DirectoryIndex command is being ingnored:

<IfModule dir_module>
    DirectoryIndex index.html index.htm index.shtml index.php index.php5
index.php4 index.php3 index.phtml index.cgi </IfModule>

Any ideas why the rewrite isn't working right? The purpose is to redirect
the request to newdomain.com to a subdirectory and rewrite the URL so it
looks like it's going to the root of that directory rather than the subdir
of the parent domain.

The log shows it redirecting successfully, and I've checked all the
perms/owner:

[Sat Aug 17 08:15:17.607554 2013] [rewrite:trace1] [pid 10092]
mod_rewrite.c(468): [client X.X.X.X:51466] X.X.X.X  - -
[www.newdomain.com/sid#1049ac0][rid#1c6f1b0/initial] [perdir
/home/newuser/domains/topdomain.com/public_html/] internal redirect with
/newdomain/ [INTERNAL REDIRECT]

But it just doesn't load index.shtml or index.php

Any assistance would be appreciated!



---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Mime
View raw message