【发布时间】:2011-07-17 22:12:30
【问题描述】:
我在我的项目中使用 GET 请求,我想以一种简单的方式重写 URL:如果我访问 mydomain.com/test,它将在我的服务器端请求 mydomain.com/get.php?txt=test。
这是我的 .htaccess RewriteRule,它工作正常,但问题是它也会影响我的 index.php,所以如果我转到主页,它会启动:mydomain.com/get.php?txt=test 请求并且因为我的 RewriteRule 而没有打开 mydomain.com/index.php。
Options +FollowSymLinks
RewriteEngine On
RewriteRule (.*)$ get.php?url=$1 [L]
我不想在 mydomain.com/1/test 这样的路径中创建任何额外的子级别,它应该位于根目录的下一个级别。
任何帮助表示赞赏。谢谢!
【问题讨论】:
标签: .htaccess mod-rewrite