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
-
Why the url inspection is disabled in search console ?
In this situation, how can we make our pages be fetched by google?
On-Page Optimization | | supporthandle0 -
Embedded twitter post is good for https://www.fitness-china.com/hip-thrust-machine seo
We have short video posts on twitter. Embedded twitter post is good for https://www.fitness-china.com/hip-thrust-machine SEO?
On-Page Optimization | | ahislop5740 -
Https://www.fitness-china.com/pilates-equipment How to find the most relevant internal link pages
https://www.fitness-china.com/pilates-equipment How to find the most relevant internal link pages? site this page, find https://www.fitness-china.com/pilates-equipment-kr and https://www.fitness-china.com/pilates-equipment-jp Is there any other better way
On-Page Optimization | | ahislop5740 -
Redirect Code Needed.
Hi, Please help me redirect the following pages in htaccess. https://www.mydomain.com/FolderA/FolderB/number-of-pages.html to **https://www.mydomain.com/FolderA/FolderC/FolderB/number-of-pages.html ** I want to redirect atleast 50 pages like this. Please help Thanks
On-Page Optimization | | Kashif-Amin0 -
Removing & redirecting old pages
Hi In the case of an e-commerce store when you remove/delete an old sub department page because you no longer sell the products that page was for can you/should you redirect it to its parent main category/dept page first or just delete and let become a 404 ? Being a sub department it is obviously closely related to the main category/dept but seem strange to 301 it since its not really moved permanently to that page but i hear that's what people do to transfer that pages authority before deleting it so its not lost cheers dan
On-Page Optimization | | Dan-Lawrence0 -
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 -
URL Domain Used in Meta Description
Today I was asked if using a domain url in your meta description can have a negative impact on your website. This description includes a list of the homepage url, but directs visitors to a different internal page of the website. My concern fell with directing visitors to a different page of the site, but promoting the homepage in the description/snippet. With Penguin 2.1 release on the 4th, I'm very cautious of my links/urls. What are your thoughts behind this? What are the possible, if any negative impacts this could have on a site? This URL does have a brand name as so the Title.
On-Page Optimization | | flcity150 -
Redirecting to a keyword-rich domain URL
It's best practice to choose a domain that has keyword in it. But if someone has just launched a website and the domain name does not have keyword, is it better to purchase a new domain name that has a keyword in the name and redirect existing domain to the new domain? Will that help SEO? (This just launched website does not have any traffic or links yet.)
On-Page Optimization | | Amjath0