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
-
From an SEO perspective, which is preferable in the URL for a non-English site: local language or English?
For example, the article is titled ' गर्मी में त्वचा की देखभाल कुछ यूँ करें' (English Meaning: Skin Care Tips for Summer), which one of these three URLs is best for SEO purpose? 1. example.com/ गर्मी-में-त्वचा-की-देखभाल/ (URL in local language, Hindi in this case) 2. example.com/summer-skin-care-tips/ (URL uses English words with English translation) 3. example.com/garmi-mein-twacha-ki-dekhbhaal/ (Hindi words, but written in Roman English) A response will be much appreciated, Amit
On-Page Optimization | | DusBus0 -
To avoid the duplicate content issue I have created new urls for that specific site I am posting to and redirecting that url to the original on my site. Is this the right way to do it?
I am trying to avoid the duplicate content issue by creating new urls and redirecting them to the original url. Is this the proper way of going about it?
On-Page Optimization | | yagobi210 -
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 -
Looking for a few hours of consult from an on-page/redirection SEO guru.
Hi! I could post our question here, but I think we will need an hour or so of questions and answers. Anyone consider themselves an on-page guru or redirection strategy guru? Here is the breakdown: 1. We sell digital media. 2. Most of the pages that return for us in the serps are indexed Search Results pages. From the research we have done, these are our highest trafficked results, but also our lowest converters. We have hundreds of thousands of indexed and dynamic Search Result pages we need to deal with. 3. We are concerned about Panda eventually giving us issues with these indexed Search Pages. 4. We would like to 301 re-direct these indexed Search Results pages to applicable product pages. 5. Looking for advice on a strategy to do so which would include the best way to locate the pages we need to 301 in the SERPS, being careful that the 301 will help and not harm us, etc. Note, we are just looking for a couple of hours of discussion and guidance. We don't need a massive SEO analysis or anything. Just looking for input and guidance on this one particular issue. If you just want to answer here for free, hey, we won't complain, but are happy to pay for quality advice. PM if interested. Thanks! Craig
On-Page Optimization | | TheCraig0 -
301 Redirect to product page or category?
We manage an ecommerce website that sells health products. A few products have now been discontinued. I’m just wondering what would be the best practice in this case. Should we 301 redirect to a similar product or to a similar category page? ANY HELP IS GREATLY APPRECIATED!
On-Page Optimization | | odegi0 -
Replacing "_" with "-" in url, results in new url?
We ran SEOmoz's "On-Page Optimization" tool on a url which contains the character "_". According to the tool: "Characters which are less commonly used in URLs may cause problems with accessibility, interpretation and ranking in search engines. It is considered a best practice to stick to standard URL structures to avoid potential problems." "Rewrite the URL to contain only standard characters." Therefore we will rewrite the url, replacing "_" with "-". Will search engines consider the "-" url a different one? Do we need to 301 the old url to the new one? Thanks for your help!
On-Page Optimization | | gerardoH0 -
Two different keywords - one URL
We're new to SEO, but have two keywords that are really not quite the same, but Google has targeted the same URL for us ... which means that SEO Moz is recommending we optimize the same URL, for opposite keywords (using the on page SEO). For example, the keywords (these aren't our keywords) of say, "beer brewing" and "ways to make beer for small breweries" are both pointing at our home page. The on page SEO is showing that "beer brewing" is a rank of say, a google ranking of 9. However, "ways to ..." is a google ranking of 47. So ... what am I supposed to do now? Do I rewrite the page to have "ways to ..." more prominent? I cannot really have the title and h1's include both ... What do I do now? We have about 3 or 4 of these "pairs". -- Anthony
On-Page Optimization | | apresley0