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
-
Q&A Page Titles
Hello All! I am currently updating page titles and metadata descriptions for a websites Q&A section and have run in to a problem while updating page titles. Since it is the Q&A section of the website, all of the page titles are around 100 characters and some are up to 200 characters long. Here is an example: Page Title: My child is working below grade level in math. Do I have to purchase the curriculum from the grade below as well? The problem is that this is obviously too long for a SERP to display however I know it is best practice to have matching titles on both the title tag and page title. My question is what hurts SEO value more: the title tag and title of the page not matching or having a very long title displayed on the SERP?
On-Page Optimization | | Myles921 -
Should I noindex our WordPress Categories?
What are the conditions under which we should noindex blog categories? I'm asking because I want to decided whether or not to noindex our categories. here.
On-Page Optimization | | Heydarian1 -
SEO for multilingual and multiregional site seperated with subdirectories on same domain
Hi all, I am working on a website that is multilingual and multiregional.
On-Page Optimization | | helgeolaussen
The site is on a single TDL where the countries are seperated with subdirectories.
I am only working with SEO for one country, so just one of the subdirectories.
Do you guys have any tips on important stuff to remember when doing SEO for this site?
Any pros or cons for this? Ty0 -
How do you treat http/https and slashes at the end of a site?
I believe there is a difference between http://www.abc.com vs https://www.abc.com I also know that it shows security and whatnot, but how do you treat it? Do you submit both? Do you re-direct one to the other? What if you have had the non-secure site for years and the links are mostly crawled? My second question is similar as my report shows these two as different: http://www.abc.com/blog vs http://www.abc.com/blog/ I didn't think it made a difference, but when I submitted the links to Google it would not accept them without the slash at the end. Again, the same questions as above in regards to how to treat it. Do you submit both? Do you re-direct one to the other? What if you have had the non-slash site for years and the links are mostly crawled? -What about http://www.abc.com vs http://abc.com ? They go to the same page, but are they treated the same?
On-Page Optimization | | tiffany11030 -
Wordpress blog duplicate issue
So after looking at the set up of the blog ive found this. http://www.trespass.co.uk/blog/ http://www.trespass.co.uk/blog/category/news/ http://www.trespass.co.uk/blog/category/general/ http://www.trespass.co.uk/blog/category/snow/ Content shown on http://www.trespass.co.uk/blog/ can also be found on the other 3 urls. The permalink structure is set up as /%category%/%postname%/ which I want to change to just %postname% Obviously i want to make things as seo friendly as possible so any suggestions to do this right without losing any indexed pages etc. I have limited access to make changes to plugins etc aswell as these need to be done through the development company who manage our site. Cheers Robert
On-Page Optimization | | Trespass0 -
Wordpress SEO. How to add static content above home page posts.
I think I many have some duplicate content issues as have been adding unque content above posts in categories using the all category SEO. How can I add static content to the posts on the home page though? Any help appreciated!
On-Page Optimization | | SamCUK0 -
Moving a site from .cfm to Wordpress - How to keep the authority?
Hi guys, My client has a site built with Cold Fusion (web pages end in .cfm) and we're moving them over to Wordpress (for many reasons), keeping the same menu structure and navigation. Their previous SEO company was pretty awful, however, they did manage to establish some decent authority/backlinks for the website and its 20 or so pages. My questions: I assume I'll want to do 301 redirects for each page, possibly by editing the .htaccess file? Any advice on this? Anything else I need to consider in this move? Thanks!
On-Page Optimization | | alpen0 -
Exact Match Domains
Hi All Which strategy from below would be best for the purchase of an exact match domain... 1) www.shiny-blue-widgets.com 2) wwwshinybluewidgetsshop.com Wondered if there was much difference in either as I know both have plus and minus points.
On-Page Optimization | | PerchDigital0