[英]Root site .htaccess interferes with WordPress
我承認,.htaccess / regex是我的游戲開發中最薄弱的部分。 這是一個問題,尤其是在今天。
我在ASP中有一個客戶端的根網站,對public_html的訪問方式如下:
RewriteEngine on
RewriteRule ^$ index.php [L]
RewriteCond $1 !^(index\.php|robots\.txt|favicon\.ico|xmlpdf\.cfm|public|dynamic|googlead5e4138365a1f11.html|sitemap.xml)
RewriteRule ^(.*)$ index.php/$1 [L]
Options -Indexes
他們想在/ public_html / inventory中安裝WordPress。 顯然,.htaccess的遞歸性質引起了巨大的沖突。 問題是,我不確定如何解決這種性質的沖突。 並不是說這里有人需要審閱,但是默認的WP .htaccess是:
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
我希望有人能告訴我如何放棄WordPress子文件夾上根文件夾的冰冷握力。
謝謝一束。
這應該是根.htaccess:
Options -Indexes
RewriteEngine on
# skip WP dir
RewriteRule ^inventory(/|$) - [L,NC]
RewriteRule ^$ index.php [L]
RewriteCond $1 !^(index\.php|robots\.txt|favicon\.ico|xmlpdf\.cfm|public|dynamic|googlead5e4138365a1f11.html|sitemap.xml)
RewriteRule ^(.*)$ index.php/$1 [L]
這應該是WP /inventory/.htaccess
:
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /inventory/
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . index.php [L]
</IfModule>
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.