问题
Anyone here knows how to do this on .htaccess? I need to replace the part of URL that is inside the "[]".
Here is the URL: [http://example.com/site/second/files/]2012/08/Image.jpg
with this new URL: [http://example-two.com/media1/]2012/08/Image.jpg
Thanks in advance!
回答1:
RewriteRule ^site/second/files/(.*)$ http://example-two.com/media1/$1 [L]
回答2:
You could also use mod_alias:
Redirect 301 /site/second/files http://example-two.com/media1/
来源:https://stackoverflow.com/questions/11963402/htaccess-replace-part-of-url