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. Web Design
    4. .htaccess on wordpress multisites

    .htaccess on wordpress multisites

    Web Design
    11 3 1.2k
    • 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.
    • SanketPatel
      SanketPatel last edited by

      Hi,

      Can you check your permalink setting.

      Login to wordpress- > Settings > Permalinks

      Permalinks help available here:  http://codex.wordpress.org/Using_Permalinks

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

        I am using a custom structure which is

        /%category%/%postname%/

        In network admin and site path is also /en/

        Thats why I need to use .htaccess to process the URL on the fly and add a trailing slash if not there

        SanketPatel 1 Reply Last reply Reply Quote 0
        • SanketPatel
          SanketPatel @imsmlouis last edited by

          Can you please show me your .httaccess code ?

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

            The current htaccess is

            BEGIN WordPress

            <ifmodule mod_rewrite.c="">RewriteEngine On
            RewriteBase /
            RewriteRule ^index.php$ - [L]
            RewriteCond %{REQUEST_FILENAME} !-f
            RewriteCond %{REQUEST_FILENAME} !-d
            RewriteRule . /index.php [L]</ifmodule>

            END WordPress

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

              one suggestion i found was

              <code>RewriteEngine On
              RewriteBase /
              RewriteCond %{REQUEST_FILENAME} !-f
              RewriteCond %{REQUEST_URI} !example.php
              RewriteCond %{REQUEST_URI} !(.*)/$
              RewriteRule ^(.*)$ http://%{HTTP_HOST}/$1/ [L,R=301]</code>
              

              But alas its not working

              SanketPatel 1 Reply Last reply Reply Quote 0
              • SanketPatel
                SanketPatel @imsmlouis last edited by

                Thanks for sharing httaccess code....

                I have search for your problem and finally I found "Permalink Trailing Slash Fixer" Wordpress plugin( 5 star rating). Please try installing it.

                Hope this will solve your problem....

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

                  unfortunately this has not solved the problem as my permalinks already contain the trailing slash.

                  I really think it needs to be code in the htaccess file to add the trailing slash if a non trailing slash url is presented.

                  1 Reply Last reply Reply Quote 0
                  • Matt-Williamson
                    Matt-Williamson last edited by

                    Hi

                    Try adding this to your .htaccess

                    RewriteEngine On

                    RewriteCond %{REQUEST_FILENAME} !-f

                    RewriteRule ^(.*)([^/])$ http://%{HTTP_HOST}/$1$2/ [L,R=301]

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

                      Hi Matt

                      Thank you for this, should i put it as below

                      RewriteEngine On
                      RewriteCond %{REQUEST_FILENAME} !-f
                      RewriteRule ^(.*)([^/])$ http://%{HTTP_HOST}/$1$2/ [L,R=301]

                      BEGIN WordPress

                      <ifmodule mod_rewrite.c="">RewriteEngine On
                      RewriteBase /
                      RewriteRule ^index.php$ - [L]
                      RewriteCond %{REQUEST_FILENAME} !-f
                      RewriteCond %{REQUEST_FILENAME} !-d
                      RewriteRule . /index.php [L]</ifmodule>

                      END WordPress

                      Matt-Williamson 1 Reply Last reply Reply Quote 0
                      • Matt-Williamson
                        Matt-Williamson @imsmlouis last edited by

                        Try the following

                        BEGIN WordPress

                        RewriteEngine On

                        RewriteCond %{REQUEST_FILENAME} !-f
                        RewriteRule ^(.*)([^/])$ http://%{HTTP_HOST}/$1$2/ [L,R=301]

                        RewriteBase /
                        RewriteRule ^index.php$ - [L]
                        RewriteCond %{REQUEST_FILENAME} !-f
                        RewriteCond %{REQUEST_FILENAME} !-d
                        RewriteRule . /index.php [L]

                        END WordPress

                        If that doesn't work strip it right back save your original htaccess and try just this:

                        RewriteEngine On
                        RewriteCond %{REQUEST_FILENAME} !-f
                        RewriteRule ^(.*)([^/])$ http://%{HTTP_HOST}/$1$2/ [L,R=301]

                        If that doesn't work your mod_rewrite module might not be working check server config..

                        1 Reply Last reply Reply Quote 0
                        • 1 / 1
                        • First post
                          Last post
                        • CMS Alternatives to WordPress
                          Vijay-Gaur
                          Vijay-Gaur
                          1
                          8
                          161

                        • Migrate from HTML to Wordpress?
                          Mobilio
                          Mobilio
                          0
                          3
                          291

                        • Sitemap Wordpress
                          BlueprintMarketing
                          BlueprintMarketing
                          0
                          3
                          228

                        • About wordpress database
                          godreamvacations
                          godreamvacations
                          0
                          2
                          102

                        • Wordpress or Joomla?
                          DWallace
                          DWallace
                          0
                          8
                          252

                        • Migrating to Wordpress
                          Jinx14678
                          Jinx14678
                          0
                          4
                          196

                        • Migrating a site to Wordpress
                          Jon-C
                          Jon-C
                          0
                          6
                          233

                        • Wordpress templates
                          Doc_Sheldon
                          Doc_Sheldon
                          0
                          9
                          1.1k

                        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