我的网址是
https://lofty-tibiabot.com/new/此网站在子文件夹中-新建
我想要地址是
https://lofty-tibiabot.com/new
# BEGIN WordPress
# The directives (lines) between `BEGIN WordPress` and `END WordPress` are
# dynamically generated, and should only be modified via WordPress filters.
# Any changes to the directives between these markers will be overwritten.
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /new/
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /new/index.php [L]
</IfModule>
# END WordPress该怎么办呢?
发布于 2020-02-19 10:03:35
真的吗?
它变得有点混乱,因为Apache需要目录上的尾部斜杠来计算DirectoryIndex等。通过禁用尾部斜杠,我们必须使用mod_rewrite手动处理这种情况。
尝试以下操作:
1)将/new/.htaccess文件移动到/.htaccess的根目录中。这使.htaccess脱离了WordPress,因此WP无法再维护此文件(这不一定是件坏事)。
2)将/.htaccess文件更改为:
# Prevent mod_dir from appending the trailing slash to directories (with a 301 redirect)
DirectorySlash Off
RewriteEngine On
RewriteBase /new
# Allow mod_rewrite to match directories that do not have a trailing slash (when DirecrorySlash Off)
RewriteOptions AllowNoSlash
# Rewrite directory without trailing slash directly to the front-controller
RewriteRule ^new$ index.php [L]
# Standard front-controller
RewriteRule ^new/index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^new/. index.php [L]https://stackoverflow.com/questions/60287055
复制相似问题