【发布时间】:2015-05-13 14:38:29
【问题描述】:
所以我有类似的网址:http://localhost/folder_name/home
我想从 URL 中删除/删除 'folder_name',因此我的 URL 变为 http://localhost/home。
我已经尝试过这段代码:
RewriteEngine On
RewriteBase /
RewriteRule ^((?!folder_name/).*)$ folder_name/$1 [L,NC,R]
这段代码让我可以访问 http://localhost/home 中的 url,但每次我在浏览器中“按 ENTER”后都会访问该 URL。 URL 将再次变为http://localhost/folder_name/home
是否可以“永久删除”文件夹名称?
谢谢:)
【问题讨论】:
-
为什么不更改您的虚拟主机设置以将您的域直接指向您的文件夹名称?
标签: php codeigniter url