Wordpress & trailing slash on domain name
-
Hi recently changed my site so it is based on Wordpress, got my preferred domain set in Google webmaster as
but since moving to wordpress my domain is now having a slash put on the end of it like
Most of the links going to my homepage do not have the slash on the end so am I right in thinking I should get rid of the slash from my site so I have one consistent url?
If so any ideas how to banish the slash? Cannot seem to do it through the Wordpress general settings (despite preferred domain being set as www.domain.co.uk !)
Thanks
T
-
Takeshi, that was great thank you
-
Try this:
<code># BEGIN WordPress <IfModule mod_rewrite.c> RewriteEngine On RewriteBase / RewriteRule ^index\.php$ - [L] RewriteRule (.+)/$ $1 [R=301,L] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule . /index.php [L] IfModule></code>
-
Think it is a HTAccess issue, just opened it up and I have the following, do I just strip out the trailing slash on
RewriteBase /newsite/ or do I have to strip out a few more?
Don't like messing with my hataccess so any help to point me in the right direction would be great!
# BEGIN WordPress <ifmodule mod_rewrite.c="">RewriteEngine On RewriteBase /newsite/ RewriteRule ^index\.php$ - [L] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule . /newsite/index.php [L]</ifmodule> # END WordPress
-
Good point!
Just checked and www.domain.co.uk redirects to www.domain.co.uk/
This a htaccess issue perhaps?
-
Does www.domain.co.uk redirect to www.domain.co.uk/ or are they treated as separate pages?
-
Self hosted!
I have set it as www.domain.co.uk in the settings but for some reason it is still showing with the slash when I view the site
-
Are you on self hosted Wordpress or wordpress.com? Usually on self hosted you can edit the URL under general options.
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 Removing Zombie pages effect on domain authority?
Hi. Recently I got a project (removing zombie pages here: https://www.alamto.com/ ) As you can see this site has about 20k indexed page on google and it seems I should remove about 6000 useless indexed page. does removing (Noindex) these pages affect on the site metrics? Which metrics would affected? and how? Thanks.
On-Page Optimization | | jafarfahi1 -
How to 301 redirect, without access to .htaccess and to a new domain
There are few ways to do this and I would like to ask other Mozzers if they have found the best way. We have a site .co.uk and are moving it back to .com. However we do not have any access to the site folders for .co.uk. (We have to move it anyway as our provider is withdrawing their service). We have built our URL 301 redirect file and it is ready to go, but how to impliment it? We can repoint .co.uk to another site, and then redirect all traffic for each URL but this is quite messy, or just forget trying to 301 each page and just rediect the whole site.
On-Page Optimization | | BruceA
the .com has more authority already, but we ready do not want to frustrate visitors who are using a link to reach a product, only to find they hit our homepage and not the product. Your thoughts would be very welcome or other ideas Bruce0 -
Rel="canonical" Wordpress 2015 Best Practice
There are forum posts about how to insert rel="canonical" tags in Wordpress, but I've read about lots of changes in this space recently (updates to Yoast, for example). I'm having a problem with duplicate content on one of my sites, and it seems to be coming from multiple indexes of the same pages. I'll have a blog post show up under the posts, then the archives, then the tags. So, my question is, in early 2015, what are the current best practices for adding rel="canonical" tags in Wordpress? Thanks! Tim
On-Page Optimization | | TimLlew0 -
How do you handle URLs with slashes?
I asked this question before, but with a different scenario. I upgraded my plan to a more advanced cart and all of my URLs changed about 1.5 years ago. I knew nothing about redirects and such, so none of that was done. Basically, let's say my site was: http://www.abc.com, but when people actually visit my site, they are directed to https://www.abc.com/. I have asked my host about redirecting and she that it is not possible. In the past, the link shared has been just www.abc.com . Will this hurt my ranking? My second question is ...let's say I have a link http://www.abc.com/blog , but now, the link is http://www.abc.com/blog/ . Will I be affected, since all my old links omit the slash?
On-Page Optimization | | tiffany11030 -
Domain registered location - SEO
Hi, I just read if you are targeting a location specific term, it can help SEO if the registered address of the domain is in the same location as the location term your going after. erm, Really?
On-Page Optimization | | activitysuper0 -
Duplicate Title & Content in WordPress
I'm getting a lot of Crawl Errors due to duplicate content and duplicate title because of category and tag posts in WordPress. I rebuilt the sitemap and said to exclude category and tags, should that clear up the issue? I've also went through and did NO INDEX and NO FOLLOW for all categories and posts. Any thoughts on this issue?
On-Page Optimization | | seantgreen0 -
Developer comments in code & SEO
A client of mine has provided an SEO report that states:- "The inclusion of comments by developers in the coe is common practice..... ....its is not positive to leave large blocks of code in the site as makes crawling difficult to crawl" Im thinking that this has no SEO import at all, any one come across this? Thanks z z1eEy
On-Page Optimization | | zabba0 -
Domain.com and www.domain.com
I recently changed the settings in Google Webmaster Tools so that domain.com and www.domain.com are the same. Several quick questions. About how long will it take for Google to list www.domain.com and stop listing domain.com? The .htaccess file uses a 301 to redirect all domain.com paths.to www.domain.com paths. Now that Google has been informed these two are the same, are the 301 rules to add www necessary? The default page is index.php. so domain.com gets 301 to www.domain.com gets 301 to www.domain.com/index.php. Is this the correct way to do things? Are there SEO consultants who will help on small projects such assist on issues like this? Best,
On-Page Optimization | | ChristopherGlaeser
Christopher0