0

My current htaccess does two simple url rewrites for two simple page. Here is the code.

RewriteEngine On
RewriteRule    ^home/?$    index.php#home    [NC,L]
RewriteRule    ^contact/?$    index.php#contact    [NC,L]

now mywebsites.com and mywebsite.com/home are the same pages. I am using the twitter bootstrap carousel to flip slide between page without actually loading them.

Unfortunately the number of facebook share on mywebsite.com/home is 2000 and on mywebsite.com/ is 29. So I want to 301 redirect mywebsite.com/ to mywebsite.com/home but that puts the htaccess into an infinite loop.

any help will be widely appreciated.

2
  • Does the redirect from mywebsite.com/home to mywebsite.com/index.php#home have to be a hidden redirect? I'm not totally sure, but this seems to be not possible: stackoverflow.com/questions/5526203/… Commented Jun 25, 2012 at 16:45
  • Hi Christopher, It is totally Possible and I am already doing it. In this case the pages are actually one page and they slide transition to each other on clicking the navigation menu. It is based on a jquery carousel. Commented Jun 27, 2012 at 8:10

1 Answer 1

1

The following should allow for only ONE redirection.

RewriteCond %{ENV:REDIRECT_STATUS} 200
RewriteRule .* - [L]

Does that help?

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.