2016-08-13 63 views
0

我有以下結構打開的網頁,並用正確的.htaccess設置WordPress博客

public_html 
    files and folders like index.php and terms.php - this is what loads mywebsite.com 
    blog folder 
    wp-admin 
    wp-content 
    wp-includes 
    index.php 

現在當我打開mywebsite.com,它加載一個網站。當我打開mywebsite.com/terms時,它會加載。當我打開mywebsite.com/blog時,它會加載。但mywebsite.com/blog/my-first-post無法加載。

據WordPress的我設置在.htaccess:mywebsite.com/不

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

現在mywebsite.com/blog/my-first-post做負載,但別的了。無論是mywebsite.com/terms還是mywebsite.com/dashboard/myaccount等等。由於某些原因,這些網頁似乎在博客中,顯然這就是他們顯示404錯誤的原因。

回答

0

您應該添加此.htaccess文件中public_html/blog

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

請讓我知道,如果問題仍然存在。

+0

謝謝,它的工作! – erdomester

+0

@erdomester不客氣。 –

相關問題