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
-
Use H2 or H3 for Six Ways to Hip Thrust https://www.fitness-china.com/hip-thrust
Our article about Hip Thrust https://www.fitness-china.com/hip-thrust We have sex tips about how to hip thrust. that use h2. but Final Words use h3 or h2?
On-Page Optimization | | ahislop5740 -
Does having a \ on a URL make a difference?
On our website we have CMS pages which end normally without a /. However when linking from web banners e.c.t it always adds a / on the end. Will this have a negative impact on SEO?
On-Page Optimization | | AHF_Furniture0 -
Is my plan the right plan? - What do you suggest/do?
When trying to rank a page high for a certain keyword, I usually go by the following plan. 1. Focus on on-Page SEO. Title tags, webpage URL, unique quality content. In other words, make the page the best you can for the user using the keyword you want to rank for. 2. Promote the page via social media. 3. Try to link build to the page. Contact high-quality sites and have them try to link to your page. I was wondering if I am missing any steps, or do you use other methods when trying to rank for a certain keyword?
On-Page Optimization | | trumpfinc0 -
Indexed/Submitted URLS vs Total Indexed
Hello, My site is www.colbysphotography.com. I have Total Indexed 195 while I have 87 URLs submitted and only 79 URLs Indexed. What is the difference and is there a problem? Thanks ahead of time,
On-Page Optimization | | littlecolby
Colby0 -
Optimal URL structure for location-specific pages
I'm in the middle of revamping a website for a restaurant that has multiple locations and am trying to decide what the best URL/internal link structure would be. Right now, each restaurant has a single location page, but we are going to add additional pages for catering. Sitewide-linked pages exist for /catering and /locationname. The way I see it, we have two basic options: Option #1: Catering page - /locationname/catering/ Option #2: Catering page - /catering/locationname/ In both cases, there would be links from the /locationname an /catering pages to the location-specific catering pages. Is either option preferable to the other?
On-Page Optimization | | mblair0 -
What is the right schema.org link for a web design / developer / mobile agency?
It seems strange that a group of web developers would make up an entire structured language to designate businesses by category and somehow forget to include companies like.... web developers. So I must be missing it, what is correct to use?
On-Page Optimization | | yeagerd0 -
302 Temporary Redirects
Hi, We currently have a number of 302 redirects set up on our e-commerce store that redirect from no forward slash at the end to a forward slash at the end of the url (see below). example: domain.com/treadmills
On-Page Optimization | | DustyBraband
Redirects to
domain.com/treadmills/ Am I correct in saying that this will not pass link juice and the redirects should be changed to 301's (or just removed?). Or are the two urls treated the same (with or without forward slash)? Thanks in advance! Regards,
Dusty0 -
301 redirect usage
I just wondering if using a lot of 301 redirects could hurt to my seo? We have site which have a lot of content with such links: title: This Is Title page url: www.site.com/This-Is-Title-page.html and we use for each page 301 redirect to remove capital letters in url: www.site.com/this-is-title-page.html Is this is good idea and not hurting to seo ? Thanks in advance
On-Page Optimization | | bele0