我有以下目录结构:
/.htaccess
/index.php
/subfolder1/.htaccess
/subfolder1/index.php
/subfolder2/.htaccess
/subfolder2/index.php
我希望所有请求都被重定向到/index.php。我想通过在/.htaccess文件中做一些更改来实现这一点。
e.g. /abc to be rewritten to /index.php
e.g. /subfolder1/index.php to be rewritten to /index.php
如何使用webroot/.htaccess文件执行此操作
这是我的htaccess代码。它可以在Apache上工作,但在Litespeed上却不能很好地工作。我想要所有的html和php文件到index.php但在Litespeed, /example *works, there is no file which named example*
/folder/example.php *works, there are folder and example.php*
/folder/index.php *works, there are folder and index.php*
/folder/ *doesn't works, there
我有一个用代码点火器开发并部署在IIS Windows共享主机plesk控制面板中的应用程序。当我导航到网站时,它不会从网址中删除index.php,页面也不会被正确呈现。
Actual url:www.example.com/index.php/authExpected url:www.example.com/auth
注意:当我手动输入实际URL时,它会正确地将页面重定向到预期的URL。但当我只键入www.example.com时,这不是真的,它将用户重定向到实际的URL,即
下面是我在IIS中设置的.htaccess文件配置及其相关配置。
.htaccess
<IfModule m
我知道这里有很多关于这个话题的问题,但是我无法让我的.htaccess开始工作。
期望的
应使用/index.php将所有通信量重定向到RewriteEngine
结果:
使用以下.htaccess
RewriteEngine on
RewriteCond %{ENV:REDIRECT_STATUS} ^$
RewriteRule (.*) index.php [NC,QSA,R]
我得到以下错误(使用http://localhost/foo,应该重定向到:http://localhost/index.php )
The requested URL /index.php was not fou