.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
-
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 -
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 -
Wordpress Blog Providing SEO to Main Site
Hi, I recently started a very much "learn on the job" SEO position, transitioning from a copywriting background. We currently have a wordpress blog up and running (and producing some decent quality content too I hope!) at example.com/blog/ and a sign up page located at example.com (sorry, can't put the address right now) for a site that is being custom built as it's got some nifty software linking to back end systems. My question is whether the content on the blog will bring SEO benefits to the main domain or whether it'll just be for the blog itself? If the latter, should we navigate the blog onto the a separate page of the main site? Thanks so much! I'm learning as much as I can as quickly as I can, but somethings still get me in a little bit of a tizzy.
Web Design | | LeahHutcheon0 -
Has anyone had luck doing SEO with a wordpress website built with Parallax?
Has anyone worked with Parallax before? Is it possible and worth it to do SEO on a wordpress site that uses Parallax? I have a friend that is asking. Currently when you navigate their site there is only one URL (home page) and one title tag.
Web Design | | webestate0 -
What are some of the best website hosting platforms for Wordpress?
I'm looking for a new hosting provider and have been told to find one that specializes in Wordpress hosting because of higher page speed load times, etc.. Can anyone recommend a couple of Wordpress Hosting providers
Web Design | | webestate0 -
Best way to develop a WordPress version of your site and then move it?
I have two websites that generate hundreds of organic hits each day. I want to switch both of them to WordPress. What is the best way to go about developing these sites then making them live while still keeping the current ones up?
Web Design | | C-Style0 -
Switched From Wordpress, Traffic Dropped In Half
Hello, Thank you for taking a look at my issue. My site: http://www.getrightmusic.com A month ago, I switched from Wordpress to ExpressionEngine. The reason being I wanted a more powerful membership functionality with media uploading. After I switched, my traffic basically dropped in half. I was averaging around 4-6,000 unique visitors per day and now I am at about 2,000 per day. I resubmitted a new sitemap to Google webmasters. I also set up 301 redirects on my top 80 urls that were ranking well and driving traffic in Google. Not only did Google kick me off of my top spots in the SERP's, but I no longer get indexed as quickly as I used to. With the old Wordpress site I would get url's indexed within minutes. Now they aren't even getting indexed really at all. Is this a normal occurrence when switching site designs and systems? Do you think Google will just take a little time before they give me back some respect? Is there anything I should be doing to get back to ranking and getting indexed faster? Thanks for any help or any insight you may have. Jesse
Web Design | | getrightmusic0 -
Finally have a budget for a great seo ecommerce site but need help choosing wordpress, joomla, modx, magneto or? Thank you in advance for your generosity of time
We finally have a budget and want to dump our intuit/homestead site www.originalartbroker.com Our budget is 5k-10k but could do more if needed. I am slowly catching my competition with this homestead site that I built. But I do realize it is time to step back, figure out what is best, and hire a pro to get the job done. I am green in the seo and web development arena so please go easy on me and please help to point me in the right direction. Just went out on a limb a couple years ago playing with homestead.com site software and built what we have today. Didn't know anything about website development...it sort of just happened. I feel and know that homestead.com solution is hindering what we could be doing due to the bloated nature of the site and inability to perform such task as 301 redirects etc.... I have been able to slowly attain first page seo rankings on keywords based of the artists we carry using this po-dunk homestead platform to build my site after a ton of work education thanks to seomoz and a lot of you. But, have never asked for help and could really use some generosity of time in explaining a solution that would work best for our business. Do we just go with a wordpress site that is similar to our current setup and use their plugins? Do we use a cms software solution like magneto or joomla? We will only have 200-300 pieces at any given time. We are constantly selling and buying new pieces providing us content. We are need of a site that can perform well in terms of seo. I have heard of a lot of people talking about joomla, wordpress, and magneto. Would like to be able to have a product catalogue that ultimately sends whatever inventory we are uploading to our social sites and blogs so I don’t have to pump the product out to all of these sites. We offer free custom framing with our pieces and it would be nice to have a program that could wrap the photos of the pieces with the different frames for our customers. When I add a new piece I would like this software to have a predesigned product page that it plugs the information into. I would like it to create the url extension based of the artists name, medium used, and piece name to create unique and individual urls. I would like it to also create its own H tags throughout that product page according to the artist name description, and medium used. I would like to be able to sink this up to google merchant and other sites to carry our product. Bottom line is we sell art. We sell pieces by specific artists. We are constantly buying and selling. I need something powerful that keeps up with our content
Web Design | | forecastedinvestments1