开发者

two WordPress - main in root, dev version in subfolder

开发者 https://www.devze.com 2023-04-04 16:35 出处:网络
I got a main site using Wordpress which is set at the root of the domain. I basically want to have a DEV version of the very same WordPress (using a copy database) in a subfolder, like /dev/

I got a main site using Wordpress which is set at the root of the domain.

I basically want to have a DEV version of the very same WordPress (using a copy database) in a subfolder, like /dev/

Problem I got is that when I try accessing the dev version, the main WordPress at root seems to trap the request (htaccess?) and gives a "not found" page.

Here's my htaccess at root:

# BEGIN WordPress
<IfModule mod_rewrite.c>
Options +FollowSymLinks
RewriteEngine On

# MultiLingual domain
RewriteCond %{HTTP_HOST} ^(www.)?domain-other-language\.com*    [OR]
RewriteCond %{HTTP_HOST} ^(www.)?domain-other-language2\.com*
RewriteRule (.*) http://www.main-domain.com/$1?lang=en [R=permanent,L]

# Alternate domain
RewriteCond %{HTTP_HOST} ^(www.)?other-domain\.com*
RewriteRule (.*) http://www.main-domain.com/$1 [R=permanent开发者_StackOverflow中文版,L]

# this doesn't seem to work
RewriteRule ^dev/$ - [PT,L]

RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
# END WordPress


Try

# BEGIN WordPress
<IfModule mod_rewrite.c>
Options +FollowSymLinks
RewriteEngine On
RewriteBase /

# MultiLingual domain
RewriteCond %{HTTP_HOST} ^(www.)?domain-other-language\.com*    [OR]
RewriteCond %{HTTP_HOST} ^(www.)?domain-other-language2\.com*
RewriteRule (.*) http://www.main-domain.com/$1?lang=en [R=permanent,L]

# Alternate domain
RewriteCond %{HTTP_HOST} ^(www.)?other-domain\.com*
RewriteRule (.*) http://www.main-domain.com/$1 [R=permanent,L]

RewriteCond %{REQUEST_URI} ^dev/
RewriteRule ^dev/.*$ - [PT]

RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ./ /index.php [L]
</IfModule>
# END WordPress
0

精彩评论

暂无评论...
验证码 换一张
取 消