.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
-
Is managed wordpress hosting bad for seo?
hi, i would like to create my own website, but I am confused either to choose cpanel hosting or managed wordpress
Web Design | | alan-shultis0 -
Can I safely asume that links between subsites on a subdirectories based multisite will be treated as internal links within a single site by Google?
I am building a multisite network based in subdirectories (of the mainsite.com/site1 kind) where the main site is like a company site, and subsites are focused on brands or projects of that company. There will be links back and forth from the main site and the subsites, as if subsites were just categories or pages within the main site (they are hosted in subfolders of the main domain, after all). Now, Google's John Mueller has said: <<as far="" as="" their="" url="" structure="" is concerned,="" subdirectories="" are="" no="" different="" from="" pages="" and="" subpages="" on="" your="" main="" site.="" google="" will="" do="" its="" best="" to="" identify="" where="" sites="" separate="" using="" but="" the="" is="" same="" for="" a="" single="" site,="" you="" should="" assume="" that="" seo="" purposes,="" network="" be="" treated="" one="">></as> This sounds fine to me, except for the part "Google will do its best to identify where sites are separate", because then, if Google establishes that my multisite structure is actually a collection of different sites, links between subsites and mainsite would be considered backlinks between my own sites, which could be therefore considered a link wheel, that is, a kind of linking structure Google doesn't like. How can I make sure that Google understand my multisite as a unique site? P.S. - The reason I chose this multisite structure, instead of hosting brands in categories of the main site, is that if I use the subdirectories based multisite feature I will be able to map a TLD domain to any of my brands (subsites) whenever I'd choose to give that brand a more distinct profile, as if it really was a different website.
Web Design | | PabloCulebras0 -
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 -
Wordpress Designer - Have you heard of Jay Hafling?
We are currently browsing around to have a new site built for us as we are not happy with the current one. I checked out webdevstudio and it looks like they build quality sites, but they told me they aren't taking on small projects like mine currently. So browsing around I found this designer from the Ukraine with a nice site and nice portfolio. I am wondering if anyone has worked with him, and maybe to get some opinions on his work? I don't want to make the wrong choice here.. What do you guys think? http://www.jayhafling.com
Web Design | | DemiGR1 -
Wordpress in a subdirectory?
Hi, I've used this method a few times of developing Wordpress websites in a subdirectory and only moving the index.php file to root when the site is ready to launch. (full details of how this is done in the link below) The sites I've used this on all index correctly and rank for their terms, so I haven't seen any negatives at all. However moving forward I would like to know for sure if this is indeed SEO-friendly? note: The site functions as any other at www.domain.com, it's only the Wordpress install & admin etc. resides at: www.domain.com/wordpress/ -the pages are served to root ie. www.domain.com/about) Details.. WordPress from a subdirectory to the root directory: http://askwpgirl.com/how-do-i-move-wordpress-from-a-subdirectory-to-the-root-directory/ thanks in advance.
Web Design | | GregDixson0 -
Please help. can't change widgets in wordpress
hey everyone, i am having a weird problem. for some reason. all of a sudden (without me changing ANYTHING) my widget page in the admin dashboard will not let me edit anything what i mean is, i login, go to the widgets page, and then the dropdown menus that you drag widgets into will not let me expand to drop widgets in them. was there a wordpress update i missed? who should i contact? what if i delete the theme and re-install. will i have to change ALL the settings back again?
Web Design | | TylerAbernethy0 -
How does using a CMS (i.e. Wordpress/Drupal) affect backlinks and SEO?
So I need to build a website with over 100 pages in it. Elements of the design will probably be moved around and or tested so I need to use a CMS. It's pretty much a review site so while the content will remain static I'd like to employ A/B testing to mess with conversion rates. Wordpress has a plugin for that even. So I'm just wondering, since CMS pages are pretty much created on spot and not retrieved from a library, how this affects backlinks and anchor text? How exactly does the external website point to yours if the URL is dynamically generated? Or am I misunderstanding something? Please recommend any extra resources as well if you can.
Web Design | | seochump0 -
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