1
职位我有这种奇怪的情况下...我有一个WordPress站点安装在另一个站点内的文件夹(示例)。这是如此,因为WordPress的网站属于一个停放的域名(example.net)。在子目录中的WordPress的网站没有正确重定向到由于在父文件夹中的.htaccess
所以!在我的主网站的文件夹,我有这样的.htaccess
## rules for error documents
ErrorDocument 400 /400.php
ErrorDocument 401 /401.php
ErrorDocument 403 /403.php
ErrorDocument 404 /404.php
ErrorDocument 500 /500.php
<IfModule mod_rewrite.c>
RewriteEngine On
## no trailing slash policy
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)/$ /$1 [L,R=301]
## rewrite html pages if there is a present php equivalent
RewriteRule ^(.*)\.html$ $1.php?%{QUERY_STRING} [L]
## if 'examle' is required, take us to the example.net domain
RewriteRule ^example - [L]
RewriteCond %{HTTP_HOST} ^(www\.)?example\.net$ [NC]
RewriteRule ^(.*)$ example/$1 [L]
</IfModule>
的WordPress网站的.htaccess是默认的一个:
# BEGIN WordPress
<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
我可以顺利打开WordPress网站的首页,然而,当我尝试去一些页/职位,我看到错误
的网页没有正确重定向
我在Apache 2.4上