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
-
Rich Snippets in wordpress websites
Hi all, What is the best and easiest plugin to configure and implement on WordPress blog websites? And what is the specific markup recommended for blog/article sites? Thanks!
On-Page Optimization | | emojo0 -
International website - Image names
Hello All! In an international website, it is recommended to have a copy of every image for every language in the website (with translate filenames)? or it is better to use only one copy of each image and change only the alt attributes? Thanks for the help.
On-Page Optimization | | dMaLasp0 -
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 -
Optimizing images on website. Is it bad to use the same alt names and keywords?
I have a webpage that I have 6 separate images showing step by step instructions of how to use our product with a sentence describing instruction inside image. I took screenshots of the instructions from the products App and uploaded them to webpage because they provide a great visual. I want to make sure I optimize correctly, can I use the same keywords for all the image names?
On-Page Optimization | | artscube.biz0 -
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 -
How Do I Get Rel=Author to Work Via Wordpress SEO by Yoast?
I have read Yoast's tutorial and others on how to get rel=author to work properly on my site (http://injuryattorneyshouston.com). Here are the results I get from the Google Structured Data Testing Tool: "Authorship is working for this webpage." "rel=author markup has successfully established authorship for this webpage." "Publisher markup is verified for this page." All seems well except for this: hatom-feed | hatom-entry: | |
On-Page Optimization | | cbizzle
| Error: At least one field must be set for HatomEntry.Error: Missing required field "entry-title".Error: Missing required field "updated".Error: Missing required hCard "author". |
| Error: At least one field must be set for HatomEntry.Error: Missing required field "entry-title".Error: Missing required field "updated".Error: Missing required hCard "author". | Does anyone know how to fix this?0 -
How do I do a 301 Redirect in Wordpress
I have several pages that are showing up as "duplicate" on my Wordpress based site based upon the structure of site. I was wondering how to do a 301 redirect for these pages
On-Page Optimization | | SteveSweat0 -
Different names for Twitter/Facebook, and site?
Greetings, I want to optimize my site, www.atstrust.com. I know that posts to Facebook and Twitter help improve ranks. Does it matter though if my twitter/facebook sites have a different name than the domain I am optimizing? For example, my Facebook site is facebook.com/easyinspection. I assume that doesn't matter as long as the URLs on the site refer to my domain? Thanks! Eric
On-Page Optimization | | Ericc220