I have a site that is going from a non secure HTML/PHP site to a secure WordPress site. All pages are changing. Also going from www to non-www.
So as an example
http://www.sitename.com/contact.php
will become
https://sitename.com/contact-us/
I know how to do a typical redirect in .htaccess:
Redirect 301 /oldpage.html http://www.example.com/newpage.html
But I’m not sure how to do this when both the page location and the HTTP/HTTPS is changing as well as the www going away. The site ranks pretty well and I don’t want to lose any of that.
I’ve researched but can’t find an example of doing both at the same time.
2
Answers
You should be able to do using rule like this:
Since your page names are different you will need multiple rules like this.
Make sure to keep these rules above all other rules.
You can use the following :
The rule above rewrites the following requests :
or
http://example.com/contact.php
or
https://www.example.com/contact.php
to