【发布时间】:2016-02-25 09:14:17
【问题描述】:
一直在尝试各种方法似乎无法弄清楚如何获得以下结果。我希望我的 url 将所有内容抓取到特定点,通过该文件链接并跳过其余的 url。但是,我的包含文件需要 URL 的其余部分,因此我希望它保留在 URL 中。
这是我想要的结果:
www.homepage.com/index/somepage,这将打开“index.php”并且什么都不做。
www.homepage.com/stuff/someotherpage,这将打开“stuff.php”并且什么都不做。
所以这很简单,但我不知道在使用多个页面时如何实现这一点。我可以让它每次都简单地重定向到 index.php,但这不是我想要的结果。
目前的进展:
<IfModule mod_rewrite.c>
RewriteEngine On
# Force everything through the index.php file
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^ index.php [L]
</IfModule>
【问题讨论】:
标签: .htaccess directory root forward