Jump to:

325 Posts in 200 Topics by 157 members

Migrating a Site to Silverstripe

SilverStripe Forums » Migrating a Site to Silverstripe » Making old static site cohabiting with SS

What you need to know when migrating your existing site to SilverStripe.

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

Page: 1
Go to End
Author Topic: 1891 Views
  • Johnny
    Avatar
    Community Member
    34 Posts

    Making old static site cohabiting with SS Link to this post

    Hi!

    I want to include an old static site in a new SS site temporary, during the construction phase of the new SS site. What I want to do is something similar to that :

    put the old site structure into a directory inside SS, something similar to 'old_site'. When receiving a request, SS checks if it's a SS url. If it's a SS url (ex: www.mysite.com/home/), then it serves that URL. If the URL doesn't exists, then it checks in the old_site directory to find its equivalent. If it doesn't find it, then the 404 error page comes up.

    For example, if, in the old site, a had a link to www.mysite.com/event123/index.html, i would put everything in /old_site/event123/, so it would stay available.

    Of course, i'd need to redirect / to /old_site/index.html the time the site is beeing constructed.

    Is this possible?

    Thanks in advance,

    JP

  • Radon
    Avatar
    Community Member
    11 Posts

    Re: Making old static site cohabiting with SS Link to this post

    Use the same strategy as SilverStripe Static Publisher functionality. Solve it with Apaches mod_rewrite. Modify the .htaccess file (or the vhost if you prefer) to check for your static html files (this works if you have the complete site as static html). Check the apache mod_rewrite documentation to fit it to your needs (http://httpd.apache.org/docs/2.0/mod/mod_rewrite.html):

    # Static content
    RewriteCond %{REQUEST_METHOD} ^GET$
    RewriteCond %{REQUEST_URI} /(.*)$
    RewriteCond %{DOCUMENT_ROOT}/old_site/%1.html -f
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteRule .* /old_site/%1.html [L]

  • Johnny
    Avatar
    Community Member
    34 Posts

    Re: Making old static site cohabiting with SS Link to this post

    Thank you!

    1891 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.