Welcome to %s forums

<No. 1 Community for developers, by developers/>

Login Register

How to set 301 Redirects using .htaccess file?

Chat about web technologies (IIS, Apache, etc...), hosting and server management.
Post Reply
admin
Site Admin
Posts: 45

How to set 301 Redirects using .htaccess file?

Post by admin » Thu Aug 22, 2019 3:07 pm

Redirect a single page

Code: Select all

Redirect 301 /oldpage.html http://www.example.com/newpage.html
Redirect 301 /oldpage2.html http://www.[color=#333333][size=small][font=Tahoma, Verdana, Arial, sans-serif]example[/font][/size][/color].com/folder/
Redirect an entire site
This way does it with links intact. That is www.oldsite.com/abc/pqr/link.html will become www.newsite.com/abc/pqr/link.html. This is extremely helpful when you are just "moving" a site to a new domain. Place this on the OLD site:

Code: Select all

Redirect 301 / http://newsite.com/

Post Reply