874 views
Redirections using htaccess file
It is possible to create redirections using the .htaccess file:
Requests to http://myserver/service/foo.txt will be told to access http://foo2.bar.com/service/foo.txt instead.
Apache configuration
- # Redirect single file
- Redirect 301 /service http://foo2.bar.com/service
Redirect all GIF files to like-named JPEG files on another server:
Apache configuration
- # Redirect several files
- RedirectMatch 301 (.*)\.gif$ http://www.anotherserver.com$1.jpg
Also, you can use other HTTP statuses instead of 301 with this directives. More info on Redirect and RedirectMatch directves.
Submitted by miguelSantirso over 2 years ago — last modified less than a minute ago