Moz Q&A is closed.
After more than 13 years, and tens of thousands of questions, Moz Q&A closed on 12th December 2024. Whilst we’re not completely removing the content - many posts will still be possible to view - we have locked both new posts and new replies. More details here.
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
-
Do You Add City Name & Key Word For Every Page?
Hello, I'm new to SEO but feel I have a decent grasp on it. However, I had a question pertaining to key words and using my city name in it. For instance, if I am using the key word "herniated disc treatment" do I need to put in my city name behind it or does google recognize that I am already in my city area because of my geo tagging and having it listed on the footer of my site? Any help would be greatly appreciated. Thanks! -Scott
On-Page Optimization | | slgray0 -
How to Handle duplicate pages/titles in Wordpress
The wordpress blog causes problems with page titles. If you go to the second page of blog posts it there's a different URL but with the same page title. for example: page 1: site/blog page 2: site/blog/page/2 Each page gets flagged for duplicate page titles. Thanks in advance for your thoughts,
On-Page Optimization | | heymarshall1 -
How To Change Wordpress Category Title
My categories are indexed and I want to change the category page title. At present it just defaults to the category name but I want to set a different page title. For example I want the category to be 'Motor Cars' but I want the category page title to be 'Buy Motor Cars - New And Used'. How can I do this?
On-Page Optimization | | SamCUK0 -
Two Word Company Name (Combined to One) & SEO
Hi All, I'm dealing with a company that has a two word name like "GreatCompany". They rank #1 for that but not for "Great Company". The phrase is not super competitive, but obviously they are not writing the company name with two words anywhere on their site. Has anyone had to deal with something like this? Thinking about creative solutions but I'm fairly sure we're going to need to use the name both ways to have an effect here (or use PPC to augment) but I don't really love the idea of doing that... will feel very odd and inconsistent for visitors. Thanks!
On-Page Optimization | | ketanmv0 -
CSS family names and whitespace
A CSS validation notes the following: Family names containing whitespace should be quoted. If quoting is omitted, any whitespace characters before and after the name are ignored and any sequence of whitespace characters inside the name is converted to a single space. Not sure what this means or how to fix. Help. thanks
On-Page Optimization | | casper4340 -
Image file name, is it important
If I use the same image all over my site, do I need to change the file name to avoid duplicate? Different alt text will be use on those images
On-Page Optimization | | BigBlaze2050 -
Post Title - Use the blog's name or not?
In the tile of my post, shoudl I used my blog's name in it at the end or emit the blog name. EX: title of post with keywords | name of blog OR EX: title of post with keywords The site's name is 3 words long, so I'm worrying that those extra words are diluting the keywords in the post's name that I'm trying to target.
On-Page Optimization | | gregalam0 -
301 redirect (www.domain.com/index to www.domain.com)
Hello, Please let me know what are the exact right steps in order to get rid of the duplicate content issues related with: www.domain.com/index.html same as www.domain.com without creating an infinite loop. Do you have a step by step guide posted within seomoz including 301 redirect for non www to www for all urls and index.whatever to main domain name without going into a infinite loop ? btw how to you spot the loop ? is it obvious like never ending refresh of the home page ? thanks a lot !
On-Page Optimization | | eyepaq2