【发布时间】:2012-06-05 19:56:14
【问题描述】:
我正在使用 MAMP 在我的 Mac 上使用本地主机。我正在尝试用.htaccess 做一些mod_rewrite。我认为我所有的问题都在于我正在处理这样的 URL:localhost:8888/folder/index.php。
我如何“删除” /folder/... 或让 .htaccess 与 /folder/ 一起工作,同时记住我想在项目上线后立即删除它? *我更愿意“删除” /folder/ 使其看起来更像我的项目上线时。
如果我尝试像这样“删除” index.php:
#Removes index.php
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ /index.php/$1 [L]
它一直跳回到根目录:localhost:8888/ 而不是 localhost:8888/social/。
【问题讨论】:
标签: .htaccess