Here is the solution when you need to do a 301 redirect for a URL (or many URLs) for a WordPress site the right way. This will show you how to manually add Rewrite rules directly to your
.htaccess file. This method works.
Doing a 301 Redirect for a URL on your WordPress site when you have GoDaddy shared hosting (or “Web Hosing”) can be tricky. You may notice that your
.htaccess file gets overwritten, or your Rewrite rules and Redirect rules get ignored by GoDaddy. GoDaddy support may have directed you to use their new interface for adding “URL Redirects“. But that interface lets you redirect only one at a time, and it gets very confusing if you’re hosting multiple sites on your hosting account.
Here is the right way to add 301 redirects:
- Login to your hosting account and open your
- On a new blank line at the very top of the file, enter this Rewrite Rule:
rewriterule ^old-slug.html http://yourdomain.com/new-slug/ [R=301,L]
- You must make 2 changes to the Rewrite Rule above. The tiniest details matter here.
– Change the letters “old-slug” to your own article slug (the old slug of the article that you are trying to change.) Note that the slug is not the entire URL.
– Notice that I do not use “$” after the old-slug.
– Change “yourdomain.com/new-slug/” to the new URL of the article that you are trying to change.