Redirect both / and non-/ URLs?
-
I am doing SEO on WP site. Due to some duplicate pages (rel canonical was done before) I am doing 301 redirects at the moment. And I wonder if I need to redirect both links w/ and w/o trailing slash. Default is non www, w/o trailing slash.
Like there is .com/category/news but there is same page linked in .com/news (well it works when permalink structure is set to /%category%/%postname% and returns 404 error when structure is set to /%postname%).
I redirected .lt/naujienos to .lt/category/naujienos. Should I also redirect .lt/naujienos/ (with trailing slash)?There's absolutely no problem redirecting this, but there are some more pages which I want to edit their URLs and I wonder If I should do both redirects from links /w and w/o slash?
-
There is my .htaccess at the moment:
<ifmodule mod_rewrite.c="">RewriteEngine On
RewriteBase /
RewriteRule ^index.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]</ifmodule>I don't want to mess with it because I don't have an access to cpanel.
-
Well, I want non-trailing URLs as they are at the moment. They should be (the ones without trailing slash) rel canonical as they were before I changed permalink structure ( it was set to default: /?p=123) to /%postname%
I guess I will wait a crawl to see how it is at the moment and fix all those pages with 404.
BTW, google shows my site and pages with /. Maybe it hasn't recrawled yet.
-
Another option would be to add another re-direct rule that would add a trailing slash to all of the URLS.
So effectively, if you re-direct the non-trailing URLS all URLS would then have a trailing slash.RewriteCond %{REQUEST_URI} !.[^./]+$
RewriteCond %{REQUEST_URI} !(.)/$
RewriteRule ^(.)$ /$1/ [R=301,L]Give this a try maybe? Just ensure that the REL Canonical reflects the URLS WITH the trailing slash otherwise you will get stuck in a canonical loop.
Craig Curchin
Twitter: @craigcurchin -
Fisher,
Google deals with both with / and without / as though they are the same thing so I wouldn't worry about redirecting those. If visitors normally get a trailing slash, canonicalize that, if they don't canonicalize on the URL without the slash.
http://www.mattcutts.com/blog/seo-advice-url-canonicalization/
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
-
Blog Site Set-Up/Frequency
Hello! I am a new blogger that is just getting started. All I have done so far is purchase a domain name and signed up with Blue Host. From what I am reading, WordPress seems to be the most recommended plug-in to get going. There is a lot of material out there on SEO and I wanted the community's thoughts on where to start. My blog is intended to provide readers with information on a particular topic. It is a vast area with much to write about - I intend on populating the content myself/with the help of experts in the field. It is not news so it is not time sensitive. Here are my questions: 1. As this is a brand new site, should I be blogging every day or is couple of times a week sufficient? I am able to produce content fairly quickly in the beginning as there is a lot to write about. Should I write a whole lot of content first and then release it on a schedule (twice a week, daily, etc.)? As it is a new site, I don't want it to launch with just one article.. 2. I am taking a WordPress class next week, but as someone that is not too familiar with copy/backlinks, other mechanisms to boost SEO. does WordPress make it easy enough to optimize your site for search results or does it require more expertise? As far as I see, my first tasks are to 1. ) set up the site effectively so people can find it and 2.) create valuable/engaging content. Appreciate any advice on setting up the site, blogging frequency, other tips to get going. I don't want to launch a site and get dinged by Google for reasons I am unware of..At some point, when I have a robust set of content, I am thinking of FB advertising to increase traffic to the site. Seems a bit premature to do that at this point.. Thanks all in advance for your feedback!
On-Page Optimization | | mmprakash0 -
URL Path. What is better for SEO
Hello Moz people, Is it better for SEO to have a URL path like this: flowersite.com/anniversary_flowers/dozen_roses OR flowersite.com/dozen_roses Is it better to have the full trail of pages in the URL?
On-Page Optimization | | CKerr0 -
Word count and ranking/traffic
Hello All, Recently, a client of ours enlisted another firm to redesign their website, www.thepodhotel.com. The new site went live on February 20th. Since that date, we have seen a 30% drop in Google Organic traffic, year-over-year. Even a cursory glance at the site will tell you that there was quite a bit left on the table, from an SEO point of view. However, my question pertains to word count. The word count on the new site is quite a bit lower than the old site. How much value do you feel this has on rankings? Do you feel that, among the many other items that need to be addressed, we should be focusing on creating more copy? I appreciate all of your input. Frank
On-Page Optimization | | FrankSweeney0 -
Any idea how Google is doing this? Is it schematic? http://techcrunch.com/2014/02/28/google-adds-full-restaurant-menus-to-its-search-results-pages/
Google is now showing menus on select searches. Any idea how they are getting this information? I would like to make sure my clients get visibility this way.
On-Page Optimization | | Ron_McCabe0 -
Which URL Structure is best for New Website?
Hello All, I have one client and he want to develop his website but the he want the URL structure for his website page like below: http://www.example.com/category/xxproduct.html But I have suggest him below URL Structure http://www.example.com/category/xx-product.html So Can you people please suggest me that from above which URL structure is better from SEO side as well as from Visual side..? Is using - is better to separate the words in URL?
On-Page Optimization | | jemindesai0 -
4XX comments/feed/
I have an error in my SEOMoz crawl report is a 4XX client error on two of my websites, in both cases the error is coming from the link on my wordpress blog which is http://www.techelectricity.com/blog/comments/feed/ and http://blog.rangeroffroad.com/comments/feed/ (comments/feed/ is always the problem) Should I just ignore this error because it's supposed to open your RSS reader and not a link, or is this really an error I should address? thanks!!
On-Page Optimization | | texmeix0 -
Singular / Plural
Hi SEOmoz staff I'm doing on a French website that sells Wall Stickers. The main French keyword therefore is: stickers muraux (wall stickers) sticker mural (wall sticker) When you look at my homepage title; I've put the singular and plural in there. Do you think it hurts my website? Should I eliminate my least favorite one (= sticker mural)? Any other advice? Thank you! Jacob from Belgium X45qb.jpg
On-Page Optimization | | Jacobe0