【发布时间】:2013-04-03 04:08:10
【问题描述】:
我对配置我的 .htaccess 还不是很熟悉,所以请帮帮我。
我有一个指向 index.php 的链接,但我不希望 index.php 出现在我的网址中
eg.
http://localhost/website/index.php
我希望它被重定向到根文件夹
http://localhost/website/
所以我尝试寻找答案,这就是我到目前为止所得到的。
RewriteEngine on
Options +FollowSymLinks
RewriteCond %{THE_REQUEST} ^.*/index.php
RewriteRule ^(.*)index.php$ http://localhost/website/$1 [R=301,L]
现在,当我尝试在本地网站中单击主页时,而不是将我重定向到
http://localhost/website
它被重定向到这个 -
http://localhost/Applications/XAMPP/xamppfiles/htdocs/website/localhost/website/
谁能解释这是怎么回事?
【问题讨论】:
-
不。不是框架。
标签: .htaccess mod-rewrite