簡體   English   中英

子文件wordpress的沖突htaccess

[英]conflicting htaccess for subfolder wordpress

我有一個www.domain.com網站,子文件夾是www.domain.com/subsite/domain/,在子文件夾中有一個wordpress安裝。

目前主站點工作正常,我可以查看wordpress索引頁面和管理區域,但每次我嘗試訪問其中一個前端內頁時,我都會收到404錯誤。

主要的htaccess文件是:

RewriteEngine on
Options +FollowSymlinks

#RewriteCond %{HTTP_USER_AGENT} (googlebot|bingbot|Baiduspider) [NC]
#RewriteRule ^wordpress/(.*)$  - [R=403,L]

RewriteCond %{REQUEST_URI} wordpress
RewriteRule (.*) $1 [L]

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . index.php [L]

rewritecond %{http_host} ^domain.com [nc]
RewriteRule ^(.*)$ http://www.domain.com [r=301,nc]

和wordpress安裝htaccess:

# WPhtc: End Custom htaccess

<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

任何幫助將非常感激

保留主要的htaccess文件:

Options +FollowSymlinks
RewriteEngine on

RewriteRule ^subsite/domain(/|$) - [L,NC]

RewriteCond %{http_host} ^domain\.com$ [NC]
RewriteRule ^(.*)$ http://www.%{http_host}/$1 [R=301,L]

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . index.php [L]

更新:

這應該是你的/subsite/domain/.htaccess

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /subsite/domain/

RewriteRule ^index\.php$ - [L]

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . index.php [L]
</IfModule>

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM