homepage Welcome to WebmasterWorld Guest from 54.166.100.8
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member
Home / Forums Index / Code, Content, and Presentation / Apache Web Server
Forum Library, Charter, Moderators: Ocean10000 & incrediBILL & phranque

Apache Web Server Forum

    
using htaccess for static website
lots of folders with index.html
experienced




msg:4328634
 7:49 am on Jun 21, 2011 (gmt 0)

i have my client website whihc is a static website having appx 5000 static folders and each folder has index.html inside. he has both the version indexed in the engines like
/folder/ & /folder/index.html which are serving the same content, i want to remove the canonical issue and want to redirect all the

/folder/index.html to /folder/ in htaccess.

Please suggest, so i dont need to edit the all 5000 folder for the correct linking and then redirecting and all.

Rgds

 

g1smd




msg:4328636
 8:04 am on Jun 21, 2011 (gmt 0)

That redirect is two lines of code, and the RewriteCond should test THE_REQUEST.

A quick check shows the code has been posted nearly 2000 times before in this very forum.

[google.com...]

Use code that has been posted in the last few months, not some version from years ago. You need a directive that preserves the requested path in the redirect.

You DO also need to fix the links on the site to point to
www.example.com/ and www.example.com/folder/ but you can work on that over time.
Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Code, Content, and Presentation / Apache Web Server
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved