.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
-
Switched from Wix to Wordpress dreaded hashtag URL
Recently took over managing a site for a non-profit which was using the dreaded Wix. Switched over to Wordpress but now Google still has the old URL's with the hashtag. Can't forward them in .htaccess and don't want to add javascript for fear of slowing down load time. I found a solution that seems like it will take hours and hours of work. I found the solution at http://www.thedriversgarage.com/web-technology/redirecting-hashbang-urls-wix-urls/ but it seems like it would take hours with all the URL's. I submitted an XML sitemap in Google webmaster tools. My question is, how serious could this effect SEO for my site? Google accepted the new sitemap but still has the old URL's in SERP. How long does this generally take to remove? Will the hashtag URL's penalize the site for duplicate content? If so is there a way to tell Google the homepage without hashtags is the page with original content? Sort of like the rel=canonical tag which I know wont work as the hashtag URL's all redirect to the homepage so they will all have the tag. Does Google ignore the hashtag? Could there even be a benefit to this, possibly the homepage getting more page authority due to the redirects? How serious is this? Thanks in advancing.
Web Design | | limited70 -
How to export Wordpress comments ONLY to a new domain
Hi Guys, We have a bit of situation here. We have a website (let's say it is www.oldsite.com) where we had more than 2000 posts. There arose a need whereby we had to move some 60-70 posts from this oldsite.com to another domain of ours (www.newsite.com). So, here is what we did: Move those 60-70 posts manually from oldsite.com to newsite.com Did a 301 redirect of each of those 60-70 posts from oldsite.com to newsite.com. Google has now started to rank the posts from the newsite.com for this. That's all good till now. Now, here comes the situation. We also want to move the comments from some of those posts of oldsite.com (some 10-12 posts out of those 60-70) to the respective posts of newsite.com. How do we do that? Do note that we are pretty comfortable with databases and to some extent PHP. Please help.
Web Design | | seocuppa0 -
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 -
WordPress and Redirects
I just converted my site to wordpress. Previously urls like www.waikoloavacationrentals.com/kolea-rentals/9g and www.waikoloavacationrentals.com/kolea-rentals/9g.html would go to the same page. Since using wordpress the first one will not work. I did not have redirects set up so was wondering if there is something I am forgetting to easily make it to where if someone types in both urls it will go to the same page.
Web Design | | RobDalton0 -
Drupal vs. Wordpress
I'm working with a site that is built completely in Drupal - including the blog. As we begin on a content strategy initiative the blog is vitally important but lacks core SEO functionality and is cumbersome for the content teams to work with as they have no technical background. While there will be more work required (moving the blog to a sub-domain or separate URL) to play nice with the broader drupal environment I believe it may be the better choice to move over to Wordpress and port over any existing content worth keeping. Has anyone encountered a similar scenario or have an opinion on either platform? Love to hear your thoughts both pros and cons. Thanks in advance.
Web Design | | JonClark150 -
Is it necessary to Remove 301 redirects from Wordpress after removing the 404 url from Google Webmaster?
There were many 404 urls in my site found by Google Webmaster. I've redirected these urls to the relevant urls with 301 redirect in wordpress. After that I removed these 404 urls from Google Index through Webmaster. "Should I cleanup these 301 redirects from Wordpress or not? ". Help Needed.
Web Design | | SangeetaC0 -
Online Catalog (E-commerce like) Wordpress Themes?
I'm currently looking for a Wordpress theme similar to e-commerce/shopping websites like ebay. I'm planning to put up a buy and sell site for shoes where people can upload shoe listings on their own.. The site we're planning doesn't have a buy/checkout button and paypal integration so it will look like more of an online catalog and not a shopping cart. We will just add a contact number/email in the product listing so a buyer can contact and personally meet the seller. Let me know if this can be done in Wordpress + e-commerce plugins. I would also like to know if there's a WP plugin that will allow users to use Facebook or Twitter to login/sign up in our website/platform. Let me know if this is possible in Wordpress by installing a plugin. Thanks in advance!
Web Design | | esiow20130 -
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