The Moz Q&A Forum

    • Forum
    • Questions
    • My Q&A
    • Users
    • Ask the Community

    Welcome to the Q&A Forum

    Browse the forum for helpful insights and fresh discussions about all things SEO.

    1. SEO and Digital Marketing Q&A Forum
    2. Categories
    3. On-Page / Site Optimization
    4. Wordpress & trailing slash on domain name

    Wordpress & trailing slash on domain name

    On-Page / Site Optimization
    8 3 995
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as question
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • Jon-C
      Jon-C last edited by

      Hi recently changed my site so it is based on Wordpress, got my preferred domain set in Google webmaster as

      www.domian.co.uk

      but since moving to wordpress my domain is now having a slash put on the end of it like

      www.domain.co.uk/

      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

      1 Reply Last reply Reply Quote 0
      • Martin_Harris
        Martin_Harris last edited by

        Are you on self hosted Wordpress or wordpress.com? Usually on self hosted you can edit the URL under general options.

        Jon-C 1 Reply Last reply Reply Quote 0
        • Jon-C
          Jon-C @Martin_Harris last edited by

          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

          Martin_Harris Jon-C TakeshiYoung 5 Replies Last reply Reply Quote 0
          • Martin_Harris
            Martin_Harris @Jon-C last edited by

            Does www.domain.co.uk redirect to www.domain.co.uk/ or are they treated as separate pages?

            1 Reply Last reply Reply Quote 0
            • Jon-C
              Jon-C @Jon-C last edited by

              Good point!

              Just checked and www.domain.co.uk redirects to www.domain.co.uk/

              This a htaccess issue perhaps?

              1 Reply Last reply Reply Quote 0
              • Jon-C
                Jon-C @Jon-C last edited by

                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
                
                
                1 Reply Last reply Reply Quote 0
                • TakeshiYoung
                  TakeshiYoung @Jon-C last edited by

                  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>
                  
                  1 Reply Last reply Reply Quote 1
                  • Jon-C
                    Jon-C @Jon-C last edited by

                    Takeshi, that was great thank you 🙂

                    1 Reply Last reply Reply Quote 0
                    • 1 / 1
                    • First post
                      Last post
                    • Trailing slash
                      CleverPhD
                      CleverPhD
                      0
                      4
                      2.0k

                    • How to rank in Google during domain name search?
                      MindlessWizard
                      MindlessWizard
                      0
                      5
                      130

                    • Changing domain name
                      Audiohype
                      Audiohype
                      0
                      2
                      266

                    • Slash vs no slash?
                      AlanMosley
                      AlanMosley
                      0
                      5
                      714

                    • Value of Domain Names
                      Confections
                      Confections
                      0
                      4
                      437

                    • Hyphens in Domain Name
                      RobertFisher
                      RobertFisher
                      0
                      14
                      7.0k

                    • What if it is a domain name
                      wojkwasi
                      wojkwasi
                      0
                      4
                      538

                    • Trailing slash on URLs
                      webseoservices
                      webseoservices
                      0
                      7
                      679

                    Get started with Moz Pro!

                    Unlock the power of advanced SEO tools and data-driven insights.

                    Start my free trial
                    Products
                    • Moz Pro
                    • Moz Local
                    • Moz API
                    • Moz Data
                    • STAT
                    • Product Updates
                    Moz Solutions
                    • SMB Solutions
                    • Agency Solutions
                    • Enterprise Solutions
                    • Digital Marketers
                    Free SEO Tools
                    • Domain Authority Checker
                    • Link Explorer
                    • Keyword Explorer
                    • Competitive Research
                    • Brand Authority Checker
                    • Local Citation Checker
                    • MozBar Extension
                    • MozCast
                    Resources
                    • Blog
                    • SEO Learning Center
                    • Help Hub
                    • Beginner's Guide to SEO
                    • How-to Guides
                    • Moz Academy
                    • API Docs
                    About Moz
                    • About
                    • Team
                    • Careers
                    • Contact
                    Why Moz
                    • Case Studies
                    • Testimonials
                    Get Involved
                    • Become an Affiliate
                    • MozCon
                    • Webinars
                    • Practical Marketer Series
                    • MozPod
                    Connect with us

                    Contact the Help team

                    Join our newsletter
                    Moz logo
                    © 2021 - 2026 SEOMoz, Inc., a Ziff Davis company. All rights reserved. Moz is a registered trademark of SEOMoz, Inc.
                    • Accessibility
                    • Terms of Use
                    • Privacy