RewriteEngine On
RewriteRule ^(.+)$ /?path=http://domain.com.au/$1 [R=301,L]
The codes above could redirect
http://localhost/a/b/c.htm to
http://localhost/?path=http://domain.com.au/a/b/c.htm
The issue is we couldn't use .* instead.
RewriteRule ^(.+)$ /?path=http://domain.com.au/$1 [R=301,L]
The codes above could redirect
http://localhost/a/b/c.htm to
http://localhost/?path=http://domain.com.au/a/b/c.htm
The issue is we couldn't use .* instead.
本文介绍了一种使用.htaccess文件中的RewriteEngine和RewriteRule指令进行URL重定向的方法。具体展示了如何将本地服务器上的URL重定向到另一个域名,并讨论了正则表达式的使用限制。
3848

被折叠的 条评论
为什么被折叠?



