.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
-
Yoast focus keywords for portfolio post types in WordPress
This one is for the WordPress optimization crowd! Portfolios are used to display work. I have a question about best seo optimization techniques. 1. Portfolios can be used to display many different types of work, for me it either original web designs from scratch, WordPress redesigns, or importing a current website into WordPress. What is the best practice for keywords for multiple portfolios that are in one category. for instance WordPress Redesign. If I have 5 WordPress redesign portfolio posts is it good practice to use WordPress redesign for all 5 portfolios or should they use variations? Yoast gets angry when the same focus keyword is used multiple times. 2. Should portfolios even be indexed? Since this is how I attract new customers I would think yes but am I giving too much exposure to my client and not enough to my business. I guess this will depend on titles and meta descriptions. A discussion on best practices here is what I am really looking for. What is your advice and opinion on the matter.
Web Design | | donsilvernail1 -
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 -
Does anyone know if the YOAST SEO plugin works 100% on a responsive wordpress template?
Hi, Does anyone know if the YOAST SEO plugin works 100% on responsive wordpress template? In other words, when you configure the custom title and metadescription is it also configured for the tablet and cellphone views as well? Thanks Carla
Web Design | | Carla_Dawson0 -
Switching from HTML Static to WordPress Platform - SEO
Hi All, Hope everyone is doing well. I am currentyl in the process of having a re-design to myu HTML Static Site, I am switching to WordPress. My site is still running now until the new one is prepared. My question is: I do rank pretty well for some of our strong local keywords, we also have a FEW links pointing to inner pages with an extension of .HTML, should I set the the WordPress URL's to reflect .HTML or will the Search Enginesfigure out that http://www.domain/innerpage.html is the same as http://www.domain/innerpage/ or is it NOT the same. Should I switch or not? Thanks for your input Jimmy
Web Design | | jimmy02250 -
Optimizing a Wordpress Blog For SEO
Besides the standard Yoast for SEO plugin tweaks, I'm researching best practices when setting up a wordpress blog. In this instance, the "front end" of the site would be hardcoded static pages designed for an e-commerce site, while there would also be a /blog/ attached to the site - for blog posts, fresh content, etc.
Web Design | | GKLA0 -
What pluggin translator is the newest and the best to install on wordpress. Thank you very much
What pluggin translator is the newest and the best to install on wordpress. Thank you very much
Web Design | | maestrosonrisas0 -
Drupal and Wordpress on same TLD
As Rand says on the Whiteboards, "Howdy SEOmoz fans", I am obsessed with Wordpress, but wanted to spread my wings a bit and have been playing around with Drupal. I really like it. I had the idea for a new site that would have a Drupal set up (in the front end for pages and training) with a Wordpress blog on the subdomain or a directory for the Social Media integration I like to do with Wordpress. I'm just brainstorming a couple questions: 1. Would you guys and gals recommend sticking to just one or the other for SEO or does this not really matter as long as they are deep linked well? 2. Also, would you recommend subdomain or directory for WP? Have a good one, Jared
Web Design | | JaredBroker0 -
Best Wordpress Hosting
I've had a horrible experience with the security on wordpress hosting with GoDaddy. Someone recommended Blue Host as my next option. Does anyone have any experience with BlueHost and what other hosting companies would you recommend for wordpress hosting?
Web Design | | ChristineCadena0