.htaccess on wordpress multisites
-
Hi Moz fans,
I have a site thats uses wordpress multisite.
we have a number of sites set as subfolders i.e /en/ /de/ /us/ /fr/ ect.
I need to force trailing slashes on each site as I currently have the pages being spidered as /about/ and /about and /iso-9001/ and /iso-9001.
I have tried numerous things I have found online in the .htaccess and nothing is working.
Can anyone HELP!!
-
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..
-
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
-
Hi
Try adding this to your .htaccess
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)([^/])$ http://%{HTTP_HOST}/$1$2/ [L,R=301]
-
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.
-
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....
-
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
-
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
-
Can you please show me your .httaccess code ?
-
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
-
Hi,
Can you check your permalink setting.
Login to wordpress- > Settings > Permalinks
Permalinks help available here: http://codex.wordpress.org/Using_Permalinks
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
-
Will having two wordpress themes installed hurt seo?
We currently have 3 sites built on WordPress that have little to no blogging capabilities. Currently, all published posts show up on a /category page which does not resemble the traditional blog format and is not aesthetically pleasing. We would like to have a more traditional blog and are considering installing a second wordpress theme on the site which will strictly be used for /blog and all the posts. My question is will having the second WordPress installation on the sites hurt us in any way on the SEO front and if we go this way should we place the install in a subfolder or on a subdomain? Is there anything else we need to worry about with making this transition? Thank you in advance for the advice! Patrick
Web Design | | PlanetDISH0 -
Should our Wordpress blog have the same theme as Magento store?
We installed the Magento 'Aheadworks' extension for our blog but it's quite limited as to what blogging capabilities it has. We are now considering integrating Wordpress for our new blog, but keeping both on the same domain to increase the domain authority. My question is, should we keep the same theme throughout? The blog should be informative and not sales based, so we was thinking of ditching the whole theme for the blog and not having our category navigation bar. Yes we can still have internal linking which may drive traffic from the blog to the web store. We have been recommended the Wordpress Integration by Fishpig but I understand this carries through the Magento theme so I'm not sure exactly how it works. Could Wordpress plugins cause issues with our Magento store or shouldn't we be worried about this?
Web Design | | Jseddon920 -
2 or more wordpress installs on 1 domain
Hi ....I need to know if anyone has any concerns of running 2 or more WordPress installs on one domain and if so what would the concerns be. The situation is that we have a static html site that has a WordPress blog....and it is installed in example.com/blog/ . We will upgrade the static site to WordPress and this WordPress install will be in example.com/monkeys/ and then we will point its address to the root and make all other needed changes when ready to go live...but the install will stay in its own directory. So bottom-line is we have one domain with two WordPress installs that are each installed in their own sub directory and run from their own independent databases. There are quite a number of reasons for us to want to do this but I wont get into that......I just want to know if anyone has any concerns with this setup? The research we have done says its OK as well as our hosting provider....but before we get cracking we thought maybe one more "educated" input would make us feel more comfortable. Thanks
Web Design | | nomad-2023230 -
How to know if a wordpress theme is coded correctly for Seo
Hi, So I am curious if there is a tool to see if a site is coed properly for Google? I am running Avada, a standalone theme, yet I am also using a cache plugin. But when I search my code, its all like on one huge line. So I am curious if there is a way to verify or check if a theme is coded correctly? Thank you
Web Design | | Berner1 -
Wordpress Custom Permalinks Plugin Issue
Hello, I installed this plugin and I'm having trouble making it work. I'm new to WordPress so was hoping someone can help me out. I'm looking to set up the following pages for example
Web Design | | ec1976
http://testsite.azurewebsites.net/Services/Services1
http://testsite.azurewebsites.net/Services/Services2 I do the following steps Add New Page Enter the following title "Services1" Enter the following text in the Permalink textbox "Services/Services1" replacing the default text "?page_id=140" Then I publish the page. This automatically updates the "Custom Fields" section below. The name is set to "custom_permalink" and the value is set to "Services/Services1". Then I "view page" but get a 404 error. The url is "http://testsite.azurewebsites.net/Services/Services1" Some additional info 1. WordPress version 9.8.3 Settings - Permalinks is set to "post name" Custom Permalinks version 0.7.18 Any help would be greatly appreciated. Thanks0 -
Best Wordpress Themes or Theme Creators for Best SEO Results
Hi, I just recently joined SEOMOZ and am excited to be apart of the community. I am launching a blog to educate mu readers on a variety of topics. Is there any specific themes or theme creators that do a great job at structuring their themes from a technical perspective for the best SEO results? Thanks!
Web Design | | ROYINOW0 -
Wordpress SEO Change of Structure
Hi, I have a Wordpress SEO Question. I ran the SEOMOZ checker on my website and it discovered roughly 70 of my 250 blogs had a URL length problem. I have removed the year and month from the WP structure as I read elsewhere that it is not important. The blogs displayed as follows: domain.com/blog/2011/02/contents-of-the-blog and the new structure is: domain.com/blog/contents-of-the-blog I have resubmitted the new structure to Google Webmaster Tools XML and updating the on-page sitemap on my main site. My blog was cached on 25<sup>th</sup> October and seems to be caching every 7 days, my website cached on the 24th and I wonder if I should do any follow up work to ensure the content gets crawled properly. a) Individually 301 redirect the old URLs to the new. b) Individual Canonical links for each. c) Adding the old pages to the robots file and disallowing. Any advice would be greatly appreciated.
Web Design | | tdsnet0 -
Wordpress vs. mvc framework
What's the benefits of choosing an mvc framework such as codeigniter or cakephp over wordpress? Wordpress has so many plugins, and a universally known UI for customers, it just saves a ton of time. However, a lot of the 'big guys' like SEOmoz and Distilled(?) use Cakephp and other mvc frameworks so it has me wondering what the benefits are...... anyone?
Web Design | | DonnieCooper2