0

I want to redirect my broken index.html files from sub folders to home page using htaccess

Example:-

http://blogs.hds.com/hdsblog/category/
http://blogs.hds.com/hdsblog/category/sustainability/page/

are broken links (reported by Google Webmaster). These do not exist.

I want to update my htaccess file, so that URLs like these automatically redirect to the home page of my site.

1
  • We do prefer to see a wee bit of trial and error on your part rather than asking for a complete solution. Thanks. Commented Mar 20, 2013 at 1:52

1 Answer 1

0

You can use a simple RewriteRule for these URLs

RewriteRule ^hdsblog/category/ / [R,L]

This redirects all requests starting with /hdsblog/category/, including /hdsblog/category/sustainability/page/ to your home page http://blogs.hds.com/.

If you want to redirect only these exact requests, you must specify multiple RewriteRules

RewriteRule ^hdsblog/category/$ / [R,L]
RewriteRule ^hdsblog/category/sustainability/page/$ / [R,L]
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.