2016-03-02 119 views
1

在我的Apache主機設置,我有這個默認情況下,WordPress - 如何覆蓋Apache重寫規則?

RewriteCond  %{DOCUMENT_ROOT}/%{REQUEST_FILENAME} !-f 
    RewriteCond  %{DOCUMENT_ROOT}/%{REQUEST_FILENAME} !-d 
    RewriteCond  %{REQUEST_URI}       !^/server-status 
    RewriteRule  ^/([a-zA-Z0-9\_\-]+)$   /app/os?site=$1 [R,QSA] 

    RewriteCond  %{DOCUMENT_ROOT}/%{REQUEST_FILENAME} !-f 
    RewriteCond  %{DOCUMENT_ROOT}/%{REQUEST_FILENAME} !-d 
    RewriteRule  ^/([a-zA-Z0-9\_\-]+)/([a-zA-Z0-9\_\-]+)/?$  /app/os?site=$1&page=$2 [R,QSA] 

我怎麼能覆蓋現有.htaccess我的WP網站?

的.htaccess

RewriteEngine On 
RewriteBase/
RewriteRule ^index\.php$ - [L] 

# add a trailing slash to /wp-admin 
RewriteRule ^([_0-9a-zA-Z-]+/)?wp-admin$ $1wp-admin/ [R=301,L] 

RewriteCond %{REQUEST_FILENAME} -f [OR] 
RewriteCond %{REQUEST_FILENAME} -d 
RewriteRule^- [L] 
RewriteRule ^([_0-9a-zA-Z-]+/)?(wp-(content|admin|includes).*) $2 [L] 
RewriteRule ^([_0-9a-zA-Z-]+/)?(.*\.php)$ $2 [L] 
RewriteRule . index.php [L] 

目前,如果我有這個瀏覽器的地址欄上:

http://wpxxx.com/app/about 

它將被改寫爲:

http://wpxxx.com/app/os?site=about 

,如果我用這個:

http://wpxxx.com/app/about/ 

我會得到這個錯誤:

Not Found

The requested URL /about/ was not found on this server.

任何想法如何,我可以解決這個問題?

回答