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
-
Redirection chain and Javascript Redirect
Hi, A redirection chain is usually defined as a page redirecting to another page which itself is another redirection. URL1 ---(301/302)---> URL2 ---(301/302)---> URL3 But what about Javascript redirect? They seem to be a different beast: URL1 ---(301/302)---> URL2 ---(200 then Javascript redirect)---> URL3 From what I know if the javascript redirect is instant Google counts it as a 301 permanent redirection, but I'm still not sure about if this counts as a redirection chain. Most of the tools (such as moz) only see the first redirection. So is that scenario a redirection chain or no?
Technical SEO | | LouisPortier0 -
What should I name my Wordpress homepage?
I work almost exclusively in wordpress now. And I always hesitate when it comes to naming a site's homepage. I have to give it a name - right? I usually pick the business name or /home. And then that is identifies as the site's static homepage in the Wordpress settings and it works just fine. But I've started to get warning that it is an issue because it creates redirects. For example, I just ran the Ryte service analysis on a website and it warned me about "Non-indexable pages with high relevance" and it's basically my homepage that has 29 incoming links that "passes all pagerank to https://ourdomain/home But what am I supposed to call my homepage if not "Home"? It's not like the old days where anyone has to type it in. The root domain loads the homepage just as it should. Can anybody advise me regarding best practices for what to name a Wordpress homepage for good SEO? With thanks in advance for your help.
Technical SEO | | Dandelion0 -
Rel=canonical and redirect on same page
Hi Guys, Am I going slightly mad but why would you want to have a redirect and a canonical redirecting back to the same page. For Instance https://handletrade.co.uk/pull-handles/pull-handles-zcs-range/d'-pull-handle-19mm-dia.-19-x-150mm-ss/?tag=Dia.&page=2 and in the source code:- <link href="<a class="attribute-value">https://handletrade.co.uk/d'-pull-handle-19mm-dia.-19-x-150mm-ss/</a>" rel="<a class="attribute-value">canonical</a>" /> Perfect! exactly what it is intended to do. But then this page is 301 redirected tohttps://handletrade.co.uk/pull-handles/pull-handles-zcs-range/d'-pull-handle-19mm-dia.-19-x-150mm-ss/ The site is built in open cart and I think it's the SEO plugin that needs tweaking. Could this cause poor SERP visibility? This is happening across the whole site. Surely the canonical should just point to the proper page and then there is no need for an additional bounce.
Technical SEO | | nezona1 -
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 -
Magento Redirect Loop
On my clients site I changed the URL structure for products. First they had a trailing slash: http://www.wellamy.com/market/food/oklahoma-relief-effort/healthy-snacks/caramel-apple-chewy-snack-bars/ I changed it to end in .html http://www.wellamy.com/market/food/oklahoma-relief-effort/healthy-snacks/caramel-apple-chewy-snack-bars.html Now rather than redirecting properly, it causes a redirect loop. Any idea how I can fix this?
Technical SEO | | Imajery0 -
Duplicate Post Titles in WordPress with
Hi, First off, this is a WordPress specific question. we migrated a site into WordPress, with hundreds of long articles that are split into 3 or 4 pages each. Each of these articles was entered as an individual post, split into different pages using the tag. We're using the yoast seo plugin. The problem then is that each of the pages gets the same title and meta description. Has anyone a good solution to differentiate the pages? Thanks,
Technical SEO | | Andybod1 -
What is the best permalink structure for WordPress?
Hi, Does anyone have practical knowledge of the best permalink structure to use in WordPress? I have seen recommendations for just the post name or category and post name and then some who suggest having 3 digits as part of the structure for pick up in Google news. I am left a little confused - does anyone have practical experience of the best structure please?
Technical SEO | | Wallander0 -
301 redirects twice
We currently have some 301 redirects set up on our site however sometimes a page will redirect twice before reaching the final location. Is this OK from an SEO perspective to have a page redirect twice or should we concentrate on reducing it to one?
Technical SEO | | JohnHillman0