.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
-
Does having too many wordpress portfolio pages with little content hurt a site's SEO?
I have a site that is for a service company, not image based like a photographer or artist. We utilize the Portfolio feature to create a gallery of floor coating finishes (images of all the flooring finish options available) but this solution has created /portfolio/file-name pages for each image. These pages have no other content besides the image. I've run SEMrush audits on this site which shows a high percentage of pages with low text/code ratio and duplicate content (a lot of the finishes have very similar names). This site has been extremely slow to improve any visibility online (more than 9 months) and I'm wondering if this is a factor by possibly having a negative effect on our site. We initially chose the portfolio option because it was the best-looking solution for our users but we can certainly change it to another format if that is better. Thanks!
Web Design | | WillGMG0 -
Custom HTML or WordPress, it's Time to Decide
Today I start the face to face interviews with website companies. So far most have pushed WordPress, few have offered either and one insisted on Joomla. Our 50+ products and services are primarily customized, so we sell -10 on our shopping cart. We rely primarily on organic Google rankings, SEO and content is critical. What do you, my fellow Mozzers, recommend for our next website platform for our mobile world and Google friendliness? TY, KJr
Web Design | | KevnJr0 -
Wordpress shortcode or plugin for current time
In the footer of my WP site at http://www.strikemodels.com/, I have "Questions? Call us at xxx-xxx-xxxx 10:00 am to 8:00 pm Pacific time or email [address]" I've searched, but haven't easily found a shortcode where I can insert the current time for my time zone in this footer statement. Does anyone know if such a thing exists? The Do Not Disturb function on the iPhone has been a big help, but we've still had calls at three in the morning from someone in Australia on New Year's Day who didn't know how to look up time differences online.
Web Design | | KeriMorgret0 -
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 -
Hey, So I know wordpress is built with a user capability, but what about databasing custom user data?
Hi everyone, so I am working on a project with a friend of mine, without getting into too much detail, here's the problem. We need users to sign in, then for instance, click a button, and then have that action record a value of 1 in a database on our server (preferably accessible through the wordpress admin interface, and in .csv format so that we can make it easy to work with) Any help with databasing, or if wordpress is already built with SOME database technology, etc, etc For instance, SEOmoz's "mozpoint" system.. Wordpress comes built with the ability for users to log in and have profiles with special access, etc, but does it have the ability to log points and values to a specific user as well? Where should I look? What should I google to figure out options? Who could I call / hire?
Web Design | | TylerAbernethy0 -
Wordpress or custom built website?
Hello fellow mozzers, Hope you are all well. I am looking to get a website done and I am struggling to decide whether to get a custom build website site done or a website built on the WordPress platform. Would you be able to share your experiences and advice/suggestions on what you would use, and why? (pros and cons, etc.) Thanks in advance. Kind Regards
Web Design | | JonathanRolande0 -
HTML vs WordPress
Which website gets better SEO results? I was told that HTML is crawled better than WordPress. Which is a more expensive website to design? What are the pros and cons of each?
Web Design | | CapitolShine0 -
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