從我的網址中刪除「的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