Wordpress and Redirects?
-
I want to update my permalinks - actually I want to change the URL's to fit the content and keywords better. I can choose "edit" the URL, but don't I need a redirect? I don't see any htaccess Plugin installed.......is that what I need to be able to change my URL's in Wordpress?
-
Access .htaccess via Cpanel > File Manager (select view hidden files) or use and FTP program. Don;t rely on yoast. Not everyone uses Wordpress or yoast. Also Yoast can break with wp updates.
-
Hi Courtney! Did you see Dan's response to your question?
-
Hi Courtney
It should be under Yoast->Edit Files -- see this screenshot. If it's not there, are you using some sort of special host for WordPress? You're using WordPress.ORG (not .com)?
I agree that its good for you to learn, but .htaccess is something that can take down your site with one misplaced character, so I would be careful if you're going to edit it. Have a friend you can call on who might know how to fix it if something goes awry. Also, you should have FTP access readily available, in case it does break, that's how you're going to get in and fix it.
Certainly not discouraging you from learning it - just be careful and have FTP access in case you need it!
-Dan
-
All great answers guys! Thanks. Still a little confused which way to go, as it seems I have a few options. I already have Yoast installed. Where is the htaccess in wordpress?
I think I need to learn the correct way also as big spin suggests. I have been writing content for over a year, but 301's is something I haven't mastered yet.
-
Highly suggest the idea by Dan... Yoast SEO is the great plugin!
-
I recommend you learn the correct way of 301 redirects as it's handy with other CMS like Joomla or Drupal etc.
Hopefully you're using cpanel. Login to Cpanel, go to redirects tab. Create the redirect. When using Wordpress, you won't see any changes. Go back to Cpanel home and login to File Manager. Ensure to select view hidden files.
In File Manger select edit code .htacccess.
From here you will see the redirect code thnat you created in Cpanel a moment ago at the bottom. Cut and Paste this and move
It will look like this:
BEGIN WordPress
<ifmodule mod_rewrite.c="">RewriteEngine On
RewriteBase /
RewriteRule ^index.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]</ifmodule>END WordPress
RewriteCond %{HTTP_HOST} ^yourdomain.com$ [OR]
RewriteCond %{HTTP_HOST} ^www.yourdomain.com$
RewriteRule ^sample-page/$ "http://www.yourdomain.com/" [R=301,L]You now need to move the rewrite so it appears above #BEGIN WordPress, like below. Presto. 301s work. You don;t need to worry about plugins breaking etc.
RewriteCond %{HTTP_HOST} ^yourdomain.com$ [OR]
RewriteCond %{HTTP_HOST} ^www.yourdomain.com$
RewriteRule ^sample-page/$ "http://www.yourdomain.com/" [R=301,L]BEGIN WordPress
<ifmodule mod_rewrite.c="">RewriteEngine On
RewriteBase /
RewriteRule ^index.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]</ifmodule>END WordPress
-
Try this plugin : http://wordpress.org/plugins/change-permalink-helper/
I have had good success with it . As with any plugins test it out after you deploy .. there might be conflicts with other plugins or with the theme you are using
-
Thanks for that! Just want to add for Courtney - if she uses Yoast SEO plugin, you can also edit .htaccess right in wordpress without having to FTP.
-
I agree John this is the most user friendly way to do the redirects. The only thing I would add is - shut OFF the features which automatically adds redirects when you change URLs. It sounds like a nice feature, but it can get confusing because I found it to do them automatically a little too aggressively. Best to use the plugin but keep it on manual.
-
I think you could use a redirect plugin for this, for example this one here. This way you don't have to manually edit .htaccess. Just make sure the resulting URLs are using 301 redirects. It looks like there are a lot of plugins for this, so try a few out and see which you like the best!
As you change your URLs, keep track of the old and new URL mappings, and add those redirects to the plugin.
-
Hello,
Yes, if your pages are indexed and you want to change the URLs then a 301 redirect is your best bet. Edit the URL on the page or post you are looking to edit. Then add the redirect to the .htaccess file. You may need to create one to add to the root directory of your wordpress install. The general .htaccess file looks like this.
BEGIN WordPress
RewriteEngine On
RewriteBase /
RewriteRule ^index.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
END WordPress
Just add in the redirect to the end of this file. It could look something like..
redirect 301 /old-page http://www.something.com/new-page
Then you should be all set.
Got a burning SEO question?
Subscribe to Moz Pro to gain full access to Q&A, answer questions, and ask your own.
Browse Questions
Explore more categories
-
Moz Tools
Chat with the community about the Moz tools.
-
SEO Tactics
Discuss the SEO process with fellow marketers
-
Community
Discuss industry events, jobs, and news!
-
Digital Marketing
Chat about tactics outside of SEO
-
Research & Trends
Dive into research and trends in the search industry.
-
Support
Connect on product support and feature requests.
Related Questions
-
Where to put 301 redirects in my Wordpress htaccess file?
I have about 25 301 redirects in my Wordpress htaccess file, that look like this: <code>Redirect301/store/index.html https://www.notesinspanish.com/store-home/</code> At the moment they are at the bottom of my htaccess file, below the usual Wordpress rewrite rules: <code># BEGIN WordPress <ifmodulemod_rewrite.c>RewriteEngine On RewriteBase / RewriteRule ^index\.php$ - [L] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule . /index.php [L] # END WordPress</ifmodulemod_rewrite.c></code> So they are below all that. Above my WP rewrite rules I have a number of other rules from plugins (caching, ssl). Are my 301's OK where they are at the very bottom of that file? They are working, and redircting pages correctly. Should they be somewhere else? Many thanks for any help. Thanks for any help.
Technical SEO | | Benspain0 -
301 Redirect Question
I am working with a website and I ran a Screaming Frog and noticed there are 4,600 301's on the website (www.srishoes.com). It seems like the issue is between the www. and without it and they aren't working together. Is this something that the website provider should update and what type of impact might this have on the site? Thanks!
Technical SEO | | ReunionMarketing
Matt0 -
How i can remove 404 redirect error (Wordpress)
Hello ,
Technical SEO | | mayankebabu
I am getting 404 error in some pages of my wordpress site http://engineerbabu.com/ .
Those pages are permanently removed. Is there any plugin to fix this prob or anyway so that google will not crawl these pages.0 -
Duplicate content. Wordpress and Website
Hi All, Will Google punish me for having duplicate blog posts on my website's blog and wordpress? Thanks
Technical SEO | | Mike.NW0 -
How should I set up a domain redirect
A client has 2 domains that he wants to use for the same site. At the moment one domain is just an abbreviation of the main domain (not sure why) as follows: www.mygreatpropertycompany.com
Technical SEO | | davidmaxwell
www.mgpc.com (just redirects to the above) He is complaining that when he searches for 'mpc' there are no results (at all) so I'm wondering what the best approach is.There is currently nothing on the main domain that refers to 'mgpc' in it's abbreviated sense - the only place it's being used is the company's email addresses (info@mgpc.com). The redirect is simply a html file in the root of www.mgpc.com as follows: Is there anything I can do to help him out? (this is one of those 'doing a friend a favour' tasks!) Thanks!0 -
Help with 301 redirect code
Hi, I can't work out how to make this one work and would apreciate if someone could help.
Technical SEO | | Paul_MC
i have a series of folders from a old site that are in the structure:
/c/123456/bags.html (the "123456" changes and is any series of 6 digit numbers), and the "bags.html" changes depending on the product.
I need that to be 301 redirected to the following format:
/default/bags/bags.html0 -
Duplicate Page Title for Wordpress
Hello, We are using WP for our blog and keep getting Dup Page Title errors for our 12 author archives pages. The title of each page is the same, but I am wondering if this is WP issue with canonicalization working properly. The most recent four pages have a linking root domain and carry some Page Authority, but the older pages do not. Is this what Rand was talking about in his Google+ whiteboard Friday talk about blog post relevancy not lasting as long as articles? Here's what it looks like. Side question, is there a reason why the SEO Moz website doesn't have a Google+ button anywhere easy to find? Thank you, Michael
Technical SEO | | MKaloud1 -
Wordpress noindex
Hi there, Does anyone no of a way to noindex all the "previous entries" pages in a wordpress blog. They usally show on domain.com/page/2/ etc. They are the small snippets that provide a summary of the all your posts. I've not been able to find a plugin to do this. Thanks so much!
Technical SEO | | PeterM220