我在.htaccess文件中遇到了一些问题。我希望重定向并避免使用url中的index.php文件。
我的第一个网址是
www.hestiamedicare.com/web/index.php/contact
以上链接转换为
www.hestiamedicare.com/web/contact.
答案 0 :(得分:0)
它就像Yii框架web结构。 如果为true,则只需从urlManager启用漂亮的URL
'enablePrettyUrl'=>true
如果没有,请在.htaccess中使用此代码将所有请求(不直接写入文件或文件夹)重写为index.php:
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^ index.php [L]
然后处理索引文件中的请求URL。