311 Posts in 83 Topics by 149 members
|
Page:
1
|
Go to End | |
| Author | Topic: | 1799 Views |
-
Making old static site cohabiting with SS

27 May 2009 at 5:16am Last edited: 27 May 2009 5:18am
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
-
Re: Making old static site cohabiting with SS

10 June 2009 at 11:36pm
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]
| 1799 Views | ||
|
Page:
1
|
Go to Top |

