andygeers Posted February 9, 2007 Share Posted February 9, 2007 Hi there, My hosting company recently upgraded me from Apache 1 to Apache 2, and I've started seeing some quite different behaviour with my mod_rewrite stuff. Here's my .htaccess file: DirectoryIndex blog.php ErrorDocument 404 /404.html # Various rewrite rules. <IfModule mod_rewrite.c> RewriteEngine on # Rewrite current-style URLs of the form 'showpage.php?url=x'. RewriteCond %{REQUEST_FILENAME} -f RewriteCond %{REQUEST_URI} !^.*showpage\.php.*$ RewriteCond %{REQUEST_URI} !^.*ppotd_sm\.php.*$ RewriteCond %{REQUEST_URI} !^.*rss/.*$ RewriteCond %{REQUEST_URI} !^.*scripts/.*$ RewriteRule ^(.*\.(php|html))$ showpage.php?url=$1 [L,QSA] </IfModule> Now, previously with Apache 1, if you went to http://mysite.com/ then the DirectoryIndex would first take effect (http://mysite.com/blog.php) and then the RewriteRule would turn that into http://mysite.com/showpage.php?url=/blog.php Now with Apache 2, if you go to http://mysite.com/blog.php it gets rewritten as expected, but if you go to http://mysite.com/ it serves you the vanilla blog.php file, without rewriting it to showpage.php. It's as though the DirectoryIndex stops it also doing the RewriteRule. Any thoughts? Link to comment https://forums.phpfreaks.com/topic/37827-mod_rewrite-and-directoryindex/ Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.