1

I have an event website and I want visitors to www.example.org to be redirected to www.example.org/todays-info

"todays-info" is an entry, and I have "Enable strict URL'S" set to No so that I can leave out the template group.

I'm using Cloudflare, and want to cache the html of www.example.org/todays-info to reduce the load on the server, so I want everyone sent to that specific page on visiting so they hit the cached page rather than the homepage.

I'm using the standard htaccess from Ellis Lab to remove index.php and when I try this redirect I just get into a loop

Redirect 301 /  http://www.example.org/todays-info

I'm guessing that the rewrite to remove index.php is part of the problem. Any suggestions?

1 Answer 1

3

My friend... I'm afraid your syntax is incorrect. Place this rule after your index.php rewrites (at the end of the standard EllisLab htaccess file):

RedirectMatch 301 ^/?$ http://www.example.org/todays-info

This is the magic you seek. The second parameter of a RedirectMatch is a regular expression.

2
  • Thanks, I always get confused about Redirect, Rewrite & RedirectMatch and when to use which.
    – Paul Frost
    Jul 21, 2015 at 13:25
  • Oh yeah, there's always like ten different ways to accomplish stuff like this with htaccess. This is the best option unless you need to specifically avoid a 301 fire. Glad you got it resolved!
    – jrothafer
    Jul 21, 2015 at 13:27

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.