1
我最近安裝了WordPress。因爲我希望它從根目錄運行並像一些漂亮的永久鏈接,我在我的服務器的httpdocs上的htaccess文件中添加了一個新節。安裝WordPress後htaccess重寫不起作用
由於此時其他域的重定向不再起作用。
這是當前的代碼:
Options +FollowSymLinks
RewriteEngine On
#Redirect to other DOMAINS
#----------------
RewriteCond %{HTTP_HOST} (www\.)?example1.nl$ [NC]
RewriteCond %{REQUEST_URI} !^/e1/.*$
RewriteRule ^(.*)$ /e1/$1
RewriteCond %{HTTP_HOST} (www\.)?example2.nl$ [NC]
RewriteCond %{REQUEST_URI} !^/SR/.*$
RewriteRule ^(.*)$ /SR/$1
#ALTERNATE DOMAINS
# ---------------
RewriteCond %{HTTP_HOST} ^www.gw.nl$ [NC,OR]
RewriteCond %{HTTP_HOST} ^gw.nl$ [NC]
RewriteRule (.*) http://www.gw.info/$1 [R=301,L]
RewriteCond %{HTTP_HOST} ^www.cb.nl$ [NC,OR]
RewriteCond %{HTTP_HOST} ^cb.nl$ [NC]
RewriteRule (.*) http://www.gw.info/$1 [R=301,L]
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteBase/
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /wordpress/index.php [L]
</IfModule>
# END WordPress
WordPress網站的工作,因爲它應該。備用域也適用。但是,其他兩個網站完全沒有運行,現在顯示主要的WordPress網站。
如果我將RewriteRule . /wordpress/index.php [L]
更改爲RewriteRule . /index.php [L]
它將返回內部服務器錯誤。
有人知道什麼是錯誤?
也許在前2條規則中缺少標誌('[R = 301,L]'),並嘗試使用絕對URL,即「http://example1.com/...」 –
謝謝Felipe!添加標誌幫助! –