.htaccess替换URL的一部分
这里有人知道如何在.htaccess上执行此操作吗?我需要替换位于[]内的URL部分 以下是网址:[http://example.com/site/second/files/]2012/08/Image.jpg 使用此新URL:[http://example-two.com/media1/]2012/08/Image.jpg.htaccess替换URL的一部分,.htaccess,redirect,.htaccess,Redirect,这里有人知道如何在.htaccess上执行此操作吗?我需要替换位于[]内的URL部分 以下是网址:[http://example.com/site/second/files/]2012/08/Image.jpg 使用此新URL:[http://example-two.com/media1/]2012/08/Image.jpg 提前谢谢 您也可以使用mod_别名: RewriteRule ^site/second/files/(.*)$ http://example-two.com/media1/
提前谢谢 您也可以使用mod_别名:
RewriteRule ^site/second/files/(.*)$ http://example-two.com/media1/$1 [L]
Redirect 301 /site/second/files http://example-two.com/media1/
您还可以使用mod_别名:
Redirect 301 /site/second/files http://example-two.com/media1/