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
-
Advice about subpages/submenus
I am working on some pages on my site (www.crmi-online.com) and am curious as to the pros/cons of subpages/submenus. The challenge I face is that I feel like I am creating too many pages that are nearly the same which may result in way too many submenus/subpages. Is it better to make a main page heading and hyperlink to related service page vs creating a subpage for it? (OR) Have the main page heading and multiple subpages even if the copy is very close to other pages. This is the area I am having trouble with: Services > Office Automation>Workflow>Electronic Document Management>AP Processing>HR Onboarding Thanks, I hope this makes sense.
On-Page Optimization | | CRMI0 -
Page authority still on 1 after url change and 301 redirect
Hi Moz analytics suggestion to help ranking is to have a keyword or phrase in the url so I advised a client to do this they changed one of their pages urls, this page previously had a page authority of 26 since the change its gone down to 1.
On-Page Optimization | | genkee
I advised them that they must do a 301 from the old page but they took a few weeks to do this, would this of affected it why is it not showing up yet its been 3 weeks now, since the 301 and 5 weeks since the url change.0 -
URL Question
This url looks bad: http://www.patrickmunoz.com/#!classes/c1vw1 And when you click around the page change doesn't actually occur, it's a fade into the next page. I think this is a major problem for rankings. Although pages are crawled: https://www.google.com/search?q=site%3Ahttp%3A%2F%2Fwww.patrickmunoz.com%2F&oq=site%3A&aqs=chrome.2.69i57j69i58j69i59l3j69i61.3548j0j7&sourceid=chrome&espv=210&es_sm=122&ie=UTF-8 When I search for a simple page - "patrick munoz FAQs" nothing comes up:
On-Page Optimization | | tylerfraser
https://www.google.com/search?q=site%3Ahttp%3A%2F%2Fwww.patrickmunoz.com%2F&oq=site%3A&aqs=chrome.2.69i57j69i58j69i59l3j69i61.3548j0j7&sourceid=chrome&espv=210&es_sm=122&ie=UTF-8#q=patrick+munoz+|+FAQs Do you think this is a bad url configuration? Thanks! Tyler0 -
On page SEO Strategy / What pages to use?
What is the best page to use for targeting your hard to rank keywords? The keyword phrases in question here are "Acrylic Tank Manufacturing", "Custom Aquariums", & "Acrylic Aquariums" As of right now we have created 3 separate pages for each one of these keyword phrases. http://seaquaticaquariums.com/custom-aquariums for "Custom Aquariums" http://www.seaquaticaquariums.com/custom-aquariums/acrylic-aquariums/ for "Acrylic Aquariums" http://www.seaquaticaquariums.com/services/acrylic-tank-manufacturing/ for "Acrylic Tank Manufacturing" Or are we better of using the home page http://www.seaquaticaquariums.com/ for the our main hard to rank for terms. Generally speaking I would think more people will link to our home page.
On-Page Optimization | | SeaQuatic0 -
Broken Links/Images Non Optimized Content Help
Hello, After 4 years of incorrect blog creation and 4000 blog posts I have seen the light. I have implemented a new theme, SEO friendly, based on a yoast website report and have been creating timeless blogs with correct structure. However, I have 5400 broken links and images based on the Broken Link Checker. Additionally, of our 2500 blog posts which are on app reviews, only 500 are optimized so I have been painstakingly been going through each to optimize, while balancing new content output. The trouble is Google is seeing massive changes and we are tumbling in search. Any suggestions on how to approach this as it is my understanding that the broken links/images are doing considerable damage to our website overall. the website is crazymikesapps.com thank you Mike
On-Page Optimization | | crazymikesapps0 -
Lost Page Rank after directing http:// to WWW?
Hi I am trying to redirect all the non www urls to WWW. After I redirected them, most of my category page PR are dropped to 0. Can someone please tell me if this is the normal after effect after the redirect? Example url: this is PR2 before the redirect http://www.ilovebodykits.com/category/95/Body_Kits_Front_Bumpers.html
On-Page Optimization | | ilovebodykits0 -
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 -
Non essential and essential on page optimisation?
I'm very new and not to sure about seo, but i want to know what on page factors are important and what are not important (example: meta tags and meta descriptions) are they important or not, a small list would be greatly appreciated of both thanks.
On-Page Optimization | | shrikey0