从我的网址中删除“的index.php”定向到着陆页:使用的.htaccess我目前在我的.htaccess使用该
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule (.*) index.php [L]
但我也想重定向网页(即example.com)添加到临时着陆页。所以example.com应该被定向到landing.html,但是我的应用程序的任何页面(即那些运行index.php的页面)都不受影响。我想:
RewriteRule/landing.html [L,R=302]
和
RewriteRule !^index\.php$ landing.html [L,R=302]
但它弄乱出于某种原因,CSS和相对路径。任何人都可以帮忙吗?
在我的httpd.conf DocumentRoot的是/var/www/html/example.com/current
和该目录(“/电流”)被设置为AllowOverride All
而/var/www/html/example.com设置为AllowOverride None
@UlrichPalha [请不要修改标题,以解决加(http://meta.stackexchange.com/questions/116101/is-it-ok-to-add-solved-to-the-冠军的,别人 - 别人的-问题);它增加了噪音,并且已经存在一个标记为解决问题的机制。 – AakashM 2012-02-26 16:08:39