2013-11-21 57 views
0

任何時候我在URL的任何部分都有「index」這個詞,服務器或CMS會自動將它更改爲http:/domain.com(是的,只有一個正斜槓)。例如,在地址欄中輸入URL: domain.com/foo/barindex/xyz.html將自動更改爲domain.com/foo/barhttp:/domain.com/xyz.html在URL中自動替換字符串,我該如何阻止?

我使用WordPress和Apache。我檢查了.htaccess,無濟於事。本質上,由於字符串自動替換爲URL,我該如何阻止?

# BEGIN WordPress 
<IfModule mod_rewrite.c> 
RewriteEngine On 
RewriteBase/
RewriteRule ^index\.php$ - [L] 
RewriteCond %{REQUEST_FILENAME} !-f 
RewriteCond %{REQUEST_FILENAME} !-d 
RewriteRule . /index.php [L] 
</IfModule> 
# END WordPress 

# allow all except those indicated here 
<Files *> 
order allow,deny 
allow from all 
deny from xxx.xxx.xxx.xxx 
</Files> 
+0

發表您的.htaccess – Gustek

+0

的內容不要把在評論,編輯你的問題吧。 – Gustek

+0

見,也許這可以幫助你瞭解 [配置的htaccess] [1] [1]:http://stackoverflow.com/questions/5061880/this-is-the-htaccess-代碼在wordpress我不知道如何工作,可以這樣 – abfurlan

回答

0

可能是與另一個Apache配置文件,這是改變'索引'的所有事件的東西。要查找哪些文件可能會影響您的請求,請ssh進入您的服務器並運行;

httpd -v 

,尋找SERVER_CONFIG_FILE

找到並打開這個文件,並查找任何其他重寫規則,或其他配置文件的夾雜物。

你甚至可以與你的託管公司談談,以便弄清楚這一點,就好像你沒有設置這個重寫一樣,我相信他們會意識到它的存在以及它的位置。

編輯: 標準的Wordpress重寫規則;

# BEGIN WordPress 
<IfModule mod_rewrite.c> 
RewriteEngine On 
RewriteBase/
RewriteRule ^index\.php$ - [L] 
RewriteCond %{REQUEST_FILENAME} !-f 
RewriteCond %{REQUEST_FILENAME} !-d 
RewriteRule . /index.php [L] 
</IfModule> 
# END WordPress 
+0

感謝您對此的建議。 – MethodWWW

+0

不用擔心。你最終發現問題了嗎? –

+0

我們正在與託管公司談判。我會報告我們的發現! – MethodWWW