2

I want to redirect http://example.com to coming-soon.html template, but not index.html.

Possible to do it in route settings?

2 Answers 2

13

If you are trying to cover the site from the public while working on it live, i personally would name my coming soon template file 503.html

Then in the General Settings section of the control panel, switch System Status off.

That way so long as you are logged in, you can access the site as normal but anyone else visiting your site will see the contents of the 503.html template.

2
  • 1
    Never noticed this feature, good find! There's even a setting in user group rights to allow login while the site is off. While building the site you can include the coming-soon.html and later switch to a proper 503.
    – carlcs
    Commented Feb 26, 2015 at 19:17
  • Note that page status code returned 503. Probably not the best option for a coming soon page.
    – Jason
    Commented Sep 25, 2017 at 17:32
4

You can use the redirect tag. Put this in your index.html template:

{% redirect "coming-soon" %}

EDIT

If you want to stay on the homepage but want to show the template code for another page, you can use Twig include. Put this in your index.html template:

{% include "coming-soon" %}

Alternatively, just put your Coming Soon template code straight onto index.html? Either way, this answer should cover everything you need.

4
  • Thanks for this method. But this will show example.com/coming-soon. What if i just want the url link example.com
    – Hs Tung
    Commented Feb 26, 2015 at 15:04
  • Right ok, that's not really a re-direct then as you are staying on the homepage, but showing content from another page. I have updated my answer with another method.
    – Jamie Wade
    Commented Feb 26, 2015 at 15:09
  • Oops. Sorry my question not specific enough. Yeah, currently I place all my code coming soon code in index.html. I thought can do it in the route setting then easy for me set back later. Thanks alot. =)
    – Hs Tung
    Commented Feb 26, 2015 at 15:13
  • @HsTung No problem at all, glad to help!
    – Jamie Wade
    Commented Feb 26, 2015 at 15:19

Your Answer

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

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