用htaccess重定向所有网址
问题描述:
我被这个问题困住了一段时间。但是我想重新定向我的所有页面,而没有#到URL#请看下面的例子。这个例子适用于一个页面,但我希望一次获得所有页面的这个。用htaccess重定向所有网址
RewriteEngine on
Redirect permanent /index.php/artikel/contact http://www.mydomain.com/#index.php/artikel/contact
有没有办法插入一个变量或类似的东西,所以我不必一一插入我的网址?
再次感谢您的时间。
答
你想使用mod_rewrite。 http://httpd.apache.org/docs/current/mod/mod_rewrite.html
然后,而不是指定用重定向每个URL(可能甚至不需要重写引擎),可以使用paringin
RewriteCond
RewriteRule
指定使用正则表达式的条件。
希望你能理解带'#'的URI甚至不能达到Apache。它全部在浏览器中处理。 – anubhava 2012-04-04 14:49:51