.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
-
Problems preventing Wordpress attachment pages from being indexed and from being seen as duplicate content.
Hi According to a Moz Crawl, it looks like the Wordpress attachment pages from all image uploads are being indexed and seen as duplicate content..or..is it the Yoast sitemap causing it? I see 2 options in SEO Yoast: Redirect attachment URLs to parent post URL. Media...Meta Robots: noindex, follow I set it to (1) initially which didn't resolve the problem. Then I set it to option (2) so that all images won't be indexed but search engines would still associate those images with their relevant posts and pages. However, I understand what both of these options (1) and (2) mean, but because I chose option 2, will that mean all of the images on the website won't stand a chance of being indexed in search engines and Google Images etc? As far as duplicate content goes, search engines can get confused and there are 2 ways for search engines
Web Design | | SEOguy1
to reach the correct page content destination. But when eg Google makes the wrong choice a portion of traffic drops off (is lost hence errors) which then leaves the searcher frustrated, and this affects the seo and ranking of the site which worsens with time. My goal here is - I would like all of the web images to be indexed by Google, and for all of the image attachment pages to not be indexed at all (Moz shows the image attachment pages as duplicates and the referring site causing this is the sitemap url which Yoast creates) ; that sitemap url has been submitted to the search engines already and I will resubmit once I can resolve the attachment pages issues.. Please can you advise. Thanks.0 -
Managing website content/keywords for wordpress site
We are in the midst of redesigning our website and have been working with freelance blog/content writers to increase the unique content on our site. We are finding it increasingly difficult to manage the topics/keywords as we continue to expand. Googledrive and google spreadsheets have been our primary tools thus far. Can anyone recommend a good tool that would allow us to manage content and blog posts for our site?
Web Design | | Tom_Carc0 -
Can wordpress actually be bad for sites if it static?
Hello, So last year I did rank for my website. Yet I switched from Adobe Muse to wordpress. I thought it would be great for updating and blobbing if I ever do it. So I got a theme, and went for it I have Yoast and that's it for plugins. But if I take say another couple of years to blog, am I hurting myself with wordpress? Like Google knows I am using wordpress so it expects me to be creating content? I know its an odd question, just had to ask
Web Design | | Berner0 -
Wordpress or Joomla?
I'm very interested on what users here use and why? From my experience regarding online SEO, both CMSs are equal. However, the ease of use is a different story. While both systems have a learning curve, wordpress is the easiest to learn thus making it probably the most popular CMS today. Joomla on the other hand takes a bit more time to understand but when learned, can be quite flexible. So if anyone here is kind enough to add their thoughts, I'm all ears!
Web Design | | kumidiaweb0 -
Deciding which Wordpress Platform
Hey Guys, I am trying to choose which is the best platform to use to build my website. I have had a look at the following: studiopress thesis headway woothemes I've just spent a month building a website using the WIX platform only to find out that it's not SEO friendly, so before I start a new site, I just want to make sure I choose the BEST SEO FRIENDLY theme. If someone could please assist that would be greatly appreciated. Also, I already have paid for theme subscriptions to the following sites (before I joined SEOMOZ) are the following SEO friendly? https://www.elegantthemes.com/ http://www.templatemonster.com/ http://www.templatesold.com/ Thanks so much in advance
Web Design | | Giorgio680 -
Tons of 404 errors - wordpress permalink structure
hi all, noticed my crawl report is showing a ton of 404 errors. my site is running on wordpress, and i believe this is related to a change in my permalink structure (all of the pages do exist, but the url is slightly different). how does the crawl report find these 404s? When navigating around my site, the correct pages are accessible, but the report is seeing the old URL structure for some reason. Do these live in the sitemap? How can this be corrected? thanks so much for your help!
Web Design | | lsat0 -
Google Analtyics Conversion Tracking for Wordpress Life Coaching Site
Hello, How do I do conversion tracking for Google Analytics for this site: debidonner(dot)com She has a 'Thank You' page after you return from Paypal Thanks!
Web Design | | BobGW0 -
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