Jump to:

23550 Posts in 19336 Topics by 2890 members

General Questions

SilverStripe Forums » General Questions » Changing the homepage

General questions about getting started with SilverStripe that don't fit in any of the categories above.

Moderators: martimiz, Sean, biapar, Willr, Ingo, swaiba, simon_w

Page: 1
Go to End
Author Topic: 351 Views
  • Stef87
    Avatar
    Community Member
    66 Posts

    Changing the homepage Link to this post

    SilverStripe 2.4.7

    Hi

    I have implemented a method which outputs html and I call it this way. www.mysite.com/myclass/html

    My client has now decided that they want this page displayed as the homepage so when a user types in www.mysite.com it will come up. Is there a way I can achieve this in SilverStripe? I know that I can use Redirector pages but that doesn't mask the URL.

    Thanks

  • Double-A-Ron
    Avatar
    Community Member
    604 Posts

    Re: Changing the homepage Link to this post

    So how do you want the URL to act exactly?

    If I type in www.mysite.com, do you want me redirect to www.mysite.com/myclass/html? Or do you just want the content from the latter to display without the URL changing?

  • Stef87
    Avatar
    Community Member
    66 Posts

    Re: Changing the homepage Link to this post

    Hi Double-A-Ron

    Thanks for replying so quick. I want the content from the latter to display without the URL changing. Sorry if this is a really obvious question, it has me stumped though.

    Thanks

  • Double-A-Ron
    Avatar
    Community Member
    604 Posts

    Re: Changing the homepage Link to this post

    Is the method you speak of at www.mysite.com/myclass/html a Silverstripe page or plain PHP?

    Personally, I would simply port that page into your /mysite/code/HomePage.php classes so your homepage becomes a replica of the page above.

    You can use htaccess to redirect traffic hitting the homepage to a particular URL, but the URL will change as a result.

  • Stef87
    Avatar
    Community Member
    66 Posts

    Re: Changing the homepage Link to this post

    It's a SilverStripe page with a method in the controller. I have to parse HTML before it is displayed so I wasn't sure how else to do it. Ok, I'll transfer it all to a HomePage. Thanks for your help.

    351 Views
Page: 1
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.