301 redirect adding trailing slash to url
-
I am looking into a .htacess file for a site I look after and have noticed that the urls are all 301 redirecting from a none slash directory to a trailing slashed directory/folders.
e.g. www.domain.com/folder gets 301 redirected to www.domain.com/folder/
Will this do much harm and reduce the effect on the page and any links pointing to the site be lessened?
Secondly I am not sure what part of my htaccess is causing the redirect.
RewriteCond %{HTTP_HOST} !^www.domain.co.uk [NC]
RewriteCond %{HTTP_HOST} !^$
RewriteRule ^(.*) http://www.domain.co.uk/$1 [L,R,NE]RewriteCond %{THE_REQUEST} ^./index.php
RewriteRule ^(.)index.php$ /$1 [R=301,L]or could a wordpress ifmodule be causing the problem?
Any info would be apreciated.
-
Cheers all for the responses, this was pretty much what I was hoping to hear....
Thanks
Tim
-
Hi Tim,
I was literally working on this exact issue with a client yesterday. There is absolutely nothing about this to worry about. Although auditing programs like Screaming Frog will bring this up as an "issue", a manual look reveals nothing to be concerned about.
The only issue you might have is, as CleverPhD pointed out, if you have any internal linking that might be sent to the "incorrect" url, that would be something to fix. Otherwise, this is totally fine.
Best regards,
Rob
-
Agreed. Keep it. My only other question would be - do you have any internal links on your site that link to the non-slashed version of the folder? Get those fixed/cleaned up wherever possible. Your Moz crawl report should find any of those for you.
-
This is default behavior and you should keep it. It won't harm your rankings at all. I am not sure where the redirect is occurring in your install, but I wouldn't worry about it at all.
Here is a write-up on it from Google.
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
-
How to force Wordpress to remove trailing slashes?
I've searched around quite a bit for a solution here, but I can't find anything. I apologize if this is too technical for the forum. I have a Wordpress site hosted on Nginx by WP Engine. Currently it resolves requests to URLs either with or without a trailing slash. So, both of these URLs are functional: <code>mysite.com/single-post</code> and <code>mysite.com/single-post/</code> I would like to remove the trailing slash from all posts, forcing mysite.com/single-post/ to redirect to mysite.com/single-post. I created a redirect rule on the server: ^/(.*)/$ -> /$1 and this worked well for end-users, but rendered the admin panel inaccessible. Somewhere, Wordpress is adding a trailing slash back on to the URL mysite.com/wp-admin, resulting in a redirect loop. I can't see anything obvious in .htaccess. Where is this rule adding a trailing slash to 'wp-admin' established? Thanks very much
Technical SEO | | james-tb0 -
301 redirects- how long to keep and how many are too many?
Hi, I was told we have way too many 301 redirects on our site. We have some that have been there for 3 years. Our site is datacard.com . Question- how long should you keep a redirect out there when building a new page and expiring an old page? Is it 6 months, is it a certain time frame? wondering what the best practices are? Thanks! Laura
Technical SEO | | lauramrobinson320 -
To 301 or not to 301?
I have a client that is having a new site built. Their old site (WP) does not use the trailing / at the end of urls. The new site is using most of the same url names but IS using the /. For instance, the old site would be www.example.com/products and the new site, also WP, will be www.example.com/products/. WordPress will resolve either way, but my question is whether or not to go in and redirect each matching non / page to the new url that has the /. I don't want to leave any link juice on the table but if I can keep the juice without doing a few hundred 301s that certainly wouldn't suck. Any thoughts? Sleepless in KVegas
Technical SEO | | seorocket0 -
Wordpress BackupBuddy adding ?doing_wp_cron= in URLS
Hi Has anyone found WordPress Backup Buddy causing a problem with SEO. I understand why it does it, but wondered if anyone experienced issues with this? Only sometimes it adds /?doing_wp_cron=****** on to the end of a URL Thanks Tom
Technical SEO | | TomPryor831 -
301 or 410 a Pop Up Window with a New URL
I asked our development team to 301 Pop Up window URLs back to their complimentary product page as we've changed URLs for all of our Pop Ups. We have 100,000s of products on our site, so the number of rewrites are becoming unmanageable and slows server response times (their words). They want to kill these 301's after a prescribed amount of time. Should they just become 410s, leave them as 404s (current state), or insist that we keep them as 301's?
Technical SEO | | rhoadesjohn0 -
Does 301 redirect of old filenames still work?
I have gone through several revisions of my site. We used to have only static pages in HTML. I had search-engine-optimization.html changed to seo-philippines.html changed to /seo-philippines/ I 301 redirected all of them whenever I change the filenames. This is in the course of 6 years worth of link building and I'm wondering if this has an effect because our rankings go down everytime we do this.
Technical SEO | | optimind0 -
Creating a Target URL For 301 Redirect in Wordpress
I am confused as to what to put in as the target URL. Is this just a new URL that I must create a name for? I am having trouble finding any answer for this on the internet, just more people asking the same question. I am finally realizing that all the information is found right here at SEOmoz to both learn and ask questions about.
Technical SEO | | lartinos0 -
Loss of search engine positions after 301 redirect - what went wrong?!?
Hi Guys After adhering to the On Page optimisation suggestions given by SEOmoz, we redirected some of old urls to new ones. We set 301 redirects from the old pages to new on a page by page basis but our search engine ranking subsequently fell off the radar and lost PR. We confirmed redirection with fiddler and it shows 301 permanent redirect on every page as expected. To manage redirection using a common code logic we executed following: In Http module, using “rewrite path” we route “all old page requests” to a page called “redirect.aspx? oldpagename =[oldpagename]”. This happens at server side. In redirect.aspx we are redirecting from old page to new page using 301 permanent redirect. In the browser, when old page is requested, it will 301 redirect to new page. In hope we and others can learn from our mistakes - what did we do wrong ?!? Thanks in advance. Dave - www.paysubsonline.com
Technical SEO | | Evo0