Today I had some fun with .htaccess and thought you would find it useful. This is what happened.
When I changed my Theme last month, I made a “Hire Me” Page. Surprisingly, Soon I found this page on the second/third page on Google for the search “Hire WordPress Designer”.
Soon my SEO brain told me, work on it and get it to the front page. That is a real deal.
To start with, I changed the permalink from hire-me to a better permalink with keywords as hire-wordpress-designer-seo.
Google takes a long time to re-index an already indexed page, at least that’s what I have seen here on Million Clues. That’s when I decided to go for a 301 Redirect.
Help came from Taming The Best, in the form of the following article:
What is a 301 redirect?
A 301 redirect is the most efficient and spider/visitor friendly strategy around for web sites that are hosted on servers running Apache (check with your hosting service if you aren’t sure).
It’s not that hard to implement and it should preserve your search engine rankings for that particular page. If you *have* to change file names or move pages around, it’s the safest option.
A 301 redirect is implemented in your .htaccess file.
Sourced from htaccess 301 redirect tutorial
So I downloaded the .htaccess file from my root directory of this domain and took a backup, if you mess-up the .htaccess, you probably mess up almost everything. And added this code:
redirect 301 /hire-me/ https://millionclues.com/hire-wordpress-designer-seo/
This is basically a 301 redirect which redirects the page to the new location and tells the search engine spider that the page has moved permanently. Using 301 means, the new location gets all the link juice the old location enjoyed.
I added this after a line of code that made it look appropriate, you should probably add it at the end of all the code in it. It works like a charm 🙂
To check if your redirect is working properly, you can use this tool – Redirect Checker. Simple and Intuitive.
Great Tip Arun!
Permalinks is crucial for seo optimization, and many bloggers forget this step when creating their blogs or forget about it when they change themes like what you did. It’s so easy with a WordPress blog like mine where you can easily change it in the dashboard!
What do you recommend for people who aren’t “programmers” Arun?
I didn’t even check if there is a plugin available, I am a plugin minimalist, still.
I found this plugin – http://wordpress.org/extend/plugins/simple-301-redirects/ and its screenshot shows (http://wordpress.org/extend/plugins/simple-301-redirects/screenshots/) exactly like the .htaccess page. This is work 🙂
Very useful info Arun.. Another simple plugin which I suggest is Dean’s permalink migration plugin….This plugin works like charm…
Harsh, The deans migration plugin is when you change your permalink structure, right? I love his plugin, I was using it for a while when I first changed my link structure.
Yep you are right. It is used when the entire permalink structure is changed.
@ Harsh, He is talking about changing the permalink of an individual page since he found out that he was ranking well for the term “Hire WordPress Designer”
Neat way to cheat the system without actually breaking rules haha, Nice @ Arun 😉
This classifies as “Permissible Cheating” . lol @NpXp
Very interesting. I have a mortal fear of .htaccess! 🙂 I’ve used the redirect plugin — how do they differ in terms of what you wanted to accomplish?
The end result would be the same and from the similarity of the input boxes (on the Simple 301 Plugin), I think the plugin is also doing it via .htaccess.
Guess what? me too have that fear. So I drank a bottle of Mountain Dew, and got it done. Dar Ke Aage Jeeth Hai. lol
Very useful info Arun.. New look of your blog is awesome 🙂
Thank You Simran 🙂
How many such redirection rules do you have in your htaccess? I have at least 20 now 🙂
Still better is to use the built in 301 redirection capabilities of WordPress instead of pulling Apache into work. Search for ‘Urbangiraffe redirection’ and you’ll land on one of the most beautiful Wp plugins ever designed.
Also, it’s extremely dangerous to touch the htaccess unless you exactly know what you are doing.
While dealing with htaccess also remember that ‘Jeeth se aage Google penalty hain’, lol..
lol, loved that last one 😛
I have played with .htaccess before, but all those were with help from others. Glad it worked this time too 🙂
I have a doubt, why old URL not changed by this? I am seeing (millionclues.com/hire-me/) URL in Google.com in place of (millionclues.com/hire-wordpress-designer-seo/).
Alok, Thats because Google indexed that page before I changed the permalink. It takes a while for Google to re-index pages.
The 301 redirect happens in the server, we cannot work on Google Cache, but eventually Google will change it to the new one, but it takes time.
Hope am clear enough 🙂
Thanks bro. I was just thinking about this a while ago. This is really a help in time.
Good Luck
Pleasure dude, Nice to have you back. Coming for bck rt?
Using HTTP 301 redirects to save your backlink values is a wellknown fact but I’m impressed how you have implemented it to change the permalink of a particular blog post. Kudos to you 🙂
Thanks mate, welcome aboard 🙂
once i change permalinks of my blog without using any redirect plugin then i lost my traffic and pagerank.
You should have used a 301 redirect 😉
Excellent post, I am new to wordpress and this is a very useful tutorial for me. But, Still I am afraid of doing it my own.
I made a really bad mistake. I lost all my traffics when changed my permalinks without using any redirections. Can I ask all of you gensises how to fix this “after the fact” problem? I do not even know how to see the previous urls to redirect. Please help!
Thank you.
Hi,
I am converting my static HTML website into a WordPress website, it is ranking extremely well on Google and I have been advised to keep page names exactly the same. I have over 150 pages so I have been advised not to use redirects.
Becuase it is static html I have many pages ending in .htm and also many pages ending in .html as well.
Note we are talking about pages not posts.
I have found many plugins but they seem to add either .htm or .html to all webpages, I want to cherrypick which ones I call .htm and which ones I call .html, I have been told I need to use .htaccess for this. Can you enlighten me? I am not an expert here and I am afraid to make big mistakes.
I also have many pages with “_”.
I am not very good with .htaccess either. Please take this to one of Digital Point Forums, someone would definitely help you 🙂
http://forums.digitalpoint.com/forumdisplay.php?f=110
can i change url .html extension without lossing traffic
if i change url .html where crawllble url in google click getting error