.htaccess WordPress忽略目录并从该目录中删除index.php
因此,我知道如何告诉WordPress如何使用.htaccess文件忽略目录,但我希望能够从该目录中删除index.php,这样我就可以像这样访问: wordpresssite/directory/controller/function=wordpresssite/directory/.htaccess WordPress忽略目录并从该目录中删除index.php,php,wordpress,apache,.htaccess,mod-rewrite,Php,Wordpress,Apache,.htaccess,Mod Rewrite,因此,我知道如何告诉WordPress如何使用.htaccess文件忽略目录,但我希望能够从该目录中删除index.php,这样我就可以像这样访问: wordpresssite/directory/controller/function=wordpresssite/directory/index.php/controller/function 我一直在尝试,但我显然不太擅长编写.htaccess文件 谢谢 My.htaccess文件 wordpress站点名为smartronic,我想忽略并从中
index.php/
controller/function
我一直在尝试,但我显然不太擅长编写.htaccess文件
谢谢
My.htaccess文件
wordpress站点名为smartronic,我想忽略并从中删除index.php的子目录是/mailin
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /smartronic/
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_URI} !^/(mailin|mailin/.*)$
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /smartronic/index.php [L]
</IfModule>
# END WordPress
#开始WordPress
重新启动发动机
RewriteBase/smartronic/
重写规则^index\.php$-[L]
重写cond%{REQUEST_URI}^/(mailin|mailin/*)$
重写cond%{REQUEST_FILENAME}-F
重写cond%{REQUEST_FILENAME}-D
重写规则/smartronic/index.php[L]
#结束WordPress
现在转到smartronic/mailin会将我带到xampp根页面或404页面将
index.php
插入固定URL,您可以使用
如果controller
是可变的,则需要使用(…)
捕获此部分,并在替换后附加$1
RewriteRule ^mailin/(.*)$ /mailin/index.php/$1 [L]
我们可以查看您当前的访问权限吗file@rosscooperdesign我真的不明白你的要求。浏览器中的URL是什么,应该重写为什么?浏览器中的URL应该是smartronic/mailin/controller,它应该重写为smartronic/mailin/index.php/controller
RewriteRule ^mailin/(.*)$ /mailin/index.php/$1 [L]