I previously made my website with WordPress. I have a few posts which seem to doing fine (SEO). The url of my posts are www.sitename.com/this-is-post-title. I have rebuilt the the site with html, and planning on moving the blog posts to blog.sitename.com so that the new url will be blog.sitename.com/this-is-post-title.
I have a created an html file as this-is-post-title.html and set the redirect to blog.sitename.com/this-is-post-title.
this is the redirect code
<meta http-equiv = "refresh" content = "0; url = https://blog.sitename.com/this-is-post-title/" />
It works fine when sitename.com/this-is-post-title.html is accessed, but not when sitename.com/this-is-post-title is accessed. My previous post is also without .html since I was working in WordPress. Any help for me?
2
Answers
If it is a wordpress website you can use this piece of code to redirect to another page. Paste it under functions.php
Change [from slug] and [to slug] with your urls
You can add this line in your
.htaccess
file:Multiviews is a feature in Apache that will serve content from URLs without an extension by searching for similarly named files with an extension.
Alternately, you could implement redirects in
.htaccess
OR