2017-06-13 208 views
0

我在我的.htaccess文件以下規則:的WordPress:重寫規則不起作用

RewriteEngine On 
RewriteBase/

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

在WordPress的配置我有: enter image description here

但是當我嘗試想象的內容頁面獲取:enter image description here

它只能如果我使用以下網址: http://www.kobsa.com.pe/sitio/的index.php /約-U S/

+0

sitio目錄中的.htaccess文件? –

+0

這是對的。是的。 – Ricky

+0

這是因爲你有RewriteRule。 /sitio/index.php [L]作爲最後一個規則,之後的任何內容都是帖子規則 – unixmiah

回答

0
  1. 更改永久鏈接:Plain
  2. 刪除.htaccess文件
  3. 在你wp-config.phpThat's all. Stop editing...行添加前:

    定義( 'WP_SITEURL', 'HTTP://' 。 $ _SERVER ['HTTP_HOST']。 '/錫蒂奧'); ('WP_HOME','http://'。$ _SERVER ['HTTP_HOST']。'/ sitio');

  4. 更改永久鏈接:Post name

大功告成。

+0

config.php或wp-config.php? – Ricky

+0

Right - 'wp-config.php' - 我已經更正了答案。 – Picard

+0

我在「define('WP_DEBUG',false)」之後添加了在wp-config中指出的兩行;然後我去了Wordpress並將固定鏈接更改爲「發佈名稱」。然後我重新啓動了Apache服務器,但它仍然顯示我404。 – Ricky