重写完整的URL

时间:2013-01-24 15:49:37

标签: .htaccess mod-rewrite

是否有重写完整的URL,即使是使用mod-rewrite通过.htdocs的参数?

例如,如果我输入www.example.org,它必须转发给www.example.org/index.php/frontend。

任何人都有想法?

提前谢谢。

1 个答案:

答案 0 :(得分:1)

您可以检查主机名,如果它与www.example.org匹配,则重定向所有内容(包括路径和任何参数,如下所示:

RewriteCond %{HTTP_HOST} ^www.example.org$
RewriteRule ^/(.*)$ http://example.org/index.php/frontend/$1 [L,R=301]