.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
-
Ability to Transition Completed Wordpress Website to New Coder/Developer
We have worked with the same Wordpress developer since 2012. They recently redesigned our Wordpress site. We purchased a real estate theme and they performed major modifications to it. The project took 8 months. There are many customized widgets and multiple plugins. We hired a new SEO. The SEO is very comfortable coding. The SEO performed certain modifications and the code broke. The original developer stepped in and and helped restore the code. The SEO stated that the site should not be so delicate; that too many plugins and widgets are used making it inherently unstable. The original developer is claiming that the SEO did not follow best practices (they did not use a dev server to test). For a non technical business owner this is very disturbing. We finally agreed that the new SEO would make changes on a dev server and the original developer will check these changes to ensure they do not break the code. My question is, shouldn't a Wordpress site be simple enough to hand over to a decent coder with little risk of breaking the code? Are there any standards regarding the hand over of a site? I am comfortable with my developers, but what if they change professions or close their company? How would I transition the site? There must be standards and protocols that allow a third party, such as an SEO to change code without causing havoc. Any one have some insight?
Web Design | | Kingalan11 -
WordPress Category page title h1 or h2
Hi friends, I know this is a minor technical change, but we are in an extremely competitive market and I don't want to have any points against us. On our WordPress Category pages i.e. http://www.domain.com/category/�tegory-title%/ I looked at the code behind the the Title of the category page, which is "Browsing: %Category Title%" The code is an h2. I look at the posts in the category archive below, and those are also h2's. The theme preview is here and you can click on Entertainment - Reviews to see exactly what I'm referring to - http://themeforest.net/item/smartmag-responsive-retina-wordpress-magazine/full_screen_preview/6652608 I changed the code for the "Browsing: %Category Title%" to h1, which I believe is more consistent and standard formatting. 1. Is this a correct technical on-page optimization? 2. Would it be beneficial to remove "Browsing"?
Web Design | | JustinMurray0 -
Wordpress Plugin To Capture Form Completion Data, Before Visitor Hits "Submit"?
Greetings MOZ Community: Visitors frequently start to enter contact information in the forms on our website, but then chicken out and don't hit the submit button. I noticed this watching the recordings of visitor web site visits using Mouse Flow. Is there a Wordpress Plugin that would allow us to capture data entered in forms, where the visitor does not finally hit the "submit" button? Obviously this would be very, very valuable as this scenario occurs in one out of three or four instances. Thanks!!!
Web Design | | Kingalan1
Alan0 -
About wordpress database
Hi Guys, During the time I have installed wordpress many times on differents folder of my hosting service for making some experiment. how can I make sure this has not slowed down and dirty my database?
Web Design | | Italianseolover
Because I'm afraid to have deleted the wordpress folders in the pasts instead of uninstall wordpress from the wordpress autoinstall panel 😞 Could old wordpress database (that I don't use any more) slow down my primary wordpress installation? Sorry for my bad english and thank u... I am a little ignorant about databases and I am afraid about put hand on them.0 -
4XX (Client Error) on Wordpress Wesbite
I've just taken over the management of a website and am getting 4x 4XX (client Error) issues. Example: http://inter-italia.com/en/wp-login.php?action=lostpassword Can anyone give any guidance as how to fix this wordpress? I also see a lot of 'temporary redirects' due to multilingual plugin - is there anything I can do to fix this?
Web Design | | skehoe0 -
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 -
How do I learn how to build custom wordpress websites?
Is wordpress a good platform to build websites with? If so, what are some good resources to learn how to build custom websites using wordpress?
Web Design | | Lael0 -
Wordpress SEO Change of Structure
Hi, I have a Wordpress SEO Question. I ran the SEOMOZ checker on my website and it discovered roughly 70 of my 250 blogs had a URL length problem. I have removed the year and month from the WP structure as I read elsewhere that it is not important. The blogs displayed as follows: domain.com/blog/2011/02/contents-of-the-blog and the new structure is: domain.com/blog/contents-of-the-blog I have resubmitted the new structure to Google Webmaster Tools XML and updating the on-page sitemap on my main site. My blog was cached on 25<sup>th</sup> October and seems to be caching every 7 days, my website cached on the 24th and I wonder if I should do any follow up work to ensure the content gets crawled properly. a) Individually 301 redirect the old URLs to the new. b) Individual Canonical links for each. c) Adding the old pages to the robots file and disallowing. Any advice would be greatly appreciated.
Web Design | | tdsnet0