我在/子文件夹中有一个wordpress网站。
在根目录中,有一个名为/ reports /
的文件夹我需要重写url so / reports /成为/reports/index.php但是wordpress正在改变路径为/ reports /。 (我找不到页面)
这是我的.htaccess:
RewriteEngine on
RewriteBase /
# Only apply to URLs that aren't already under /wordpress2.
RewriteCond %{REQUEST_URI} !^/wordpress2/
# Rewrite all those to insert /wordpress2.
RewriteRule ^(.*)$ /wordpress2/$1
# Redirect the root folder.
RewriteCond %{HTTP_HOST} ^(www.)?website.com.au$
RewriteRule ^(/)?$ wordpress2/ [L]
RewriteCond %{HTTP_HOST} ^/reports$ [NC]
RewriteRule ^(.*)$ /reports/index.php/$1 [L,R=301]
答案 0 :(得分:0)
RewriteCond %{HTTP_HOST} ^freeloancalculator.com.au/reports$ [OR]
RewriteCond %{HTTP_HOST} ^www\.reeloancalculator\.com\.au/reports$
RewriteRule ^/?$ "http\:\/\/reeloancalculator\.com\.au/reports/index.php\/" [R=301,L]
答案 1 :(得分:0)
我没有尝试过这个,但我认为这会对你有帮助..
Options +FollowSymlinks
RewriteEngine on
RewriteRule ^([^/]+)/index.php /reports=$1/ [NC]
答案 2 :(得分:0)
通过添加./ /index.php,它解决了问题
# 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