Static HTML to Drupal

Dick Underwood - March 31, 2008 - 12:11

A week ago I got a new site www.poems-verses.com and set it up with Drupal 6. I was very impressed, and found it quite easy (so far), although I've still things to add and loads to learn and to do.

I've got another reasonably small static HTML site, and I want to convert it to Drupal. I know I can do this manually, and it wouldn't be a problem for me to copy the content of existing html 'files' into new Drupal 'pages' with the same name, although it would take me a few days.

It what be a problem if my site was down for any length of time.

I know that if I were to put Drupal onto that site and make Drupal innactive, the original site wouldn't be visible to anyone browsing, but is there a way round this?

Is there a way of putting Drupal on my site, but keeping Drupal invisible (and my original site visible) until I'd copied everything into the Drupal Pages. So that I could then make Drupal active at the end and my site would only have been off a matter of minutes.

I know there's an HTML transfer facility for version 5, but I'd like to start with 6!

Any advice would be appreciated.

Thanks.

Dick

Depends on Apache / webserver

gareth_w - March 31, 2008 - 13:04

You can install Drupal on your site, and as long as apache first searches for index.html before index.php, there will not be a problem (assuming your site uses index.html and not index.php!)

Else, you could either move your existing site to a sub-directory and redirect to that; or install Drupal in a sub-directory and move it when the conversion is finished.

Finally, you could install Drupal into a XAMPP server on your local PC and build the site there; and transfer up to the webiste once complete.

Hope one of these methods works out,
Gareth

+1 to gareth's solution. I

WorldFallz - March 31, 2008 - 13:14

+1 to gareth's solution. I usually do this by having apache go to index.html first. That makes going live as simple as changing it to index.php. Clean and easy.

Thanks for the prompt and

Dick Underwood - March 31, 2008 - 15:29

Thanks for the prompt and comprehensive replies.

Much obliged.

Dick

also, during the development

WorldFallz - March 31, 2008 - 16:45

also, during the development phase I lock out anonymous access to most stuff, turn off login requests, give out logins only to those working on development, and use the front page module to serve up a "come back later" type page to anonymous users in case people try to snoop around by manually entering the "index.php" as the URL.

So how do I tell Apache what extension to default to?

jamescarvin - April 1, 2008 - 18:34

I've got cPanel, where I'm at and it allows me to add an Apache handler extension. But I'm not sure how to write one. Is that what I need to do? If so, what would it look like?

James
Newbie here. Really all I want is to make fast web sites mostly, but with some power features and have the ability to customize, not just design, but processes, such as eCommerce features, and subscription based user levels.

I think you should just be

WorldFallz - April 1, 2008 - 18:43

I think you should just be able to edit the .htaccess file in your drupal root. Look for a line that says "DirectoryIndex index.php" and change it to "DirectoryIndex index.html". When you're ready to go live, just change it back.

I installed Drupal. I then

Dick Underwood - April 3, 2008 - 06:09

I installed Drupal.

I then edited the .htaccess from "DirectoryIndex index.php" to "DirectoryIndex index.html"

It worked a treat.
Anyone going to www. mysite .com sees all the old HTML site.
If I go to www. mysite /node I see all the Drupal site.

Thanks a lot for an easy solution that does exactly what I wanted. I'm much obliged.

Excellent. Happy to help...

WorldFallz - April 7, 2008 - 21:50

Excellent. Happy to help...

What about under sites/?

jamescarvin - April 25, 2008 - 15:52

My drupal root does have that, but I've got several sites. I guess I can't do that for all of them.

I've got drupal/sites/site1 and it has its own htaccess file etc. not at the drupal root. And then there are the other sites. I may want default to index.html in one and index.php in another.

James
Newbie here. Really all I want is to make fast web sites mostly, but with some power features and have the ability to customize, not just design, but processes, such as eCommerce features, and subscription based user levels.

I don't see how placing

dman - April 25, 2008 - 16:14

I don't see how placing .htaccess files inside /sites/sitename will do anything at all for you.
This is a misconception I've seen a few times now, and I'm not sure where it sprung from. Probably from a little confusion over the meaning of your "site folder" or something.
The Drupal dir is still your site root. The sites/* structure is a set of Drupal conventions layered over that, but your instance

roots are not your site root.

I'm not sure the best way to be inventing different htaccess rules for different subsites for you. Generally I'd do it by hand in the one main one (with some extra config conditions and rules). Or even better in the actual apache1 sites-enabled configs when needed..

.dan.
How to troubleshoot Drupal | http://www.coders.co.nz/

Good point

jamescarvin - April 25, 2008 - 18:56

The apache on my development server /apache/conf/httpd.conf has a block that says .…

DirectoryIndex index.html index.php index.aspx

The drupapl root .htaccess has
DirectoryIndex index.php and I can change that, sure enough, but at least on my development server, this results in a 403 Forbidden access. So I've had to switch it back.

I'm not so much concerned about my development server, of course. What I want is to be able to override drupal just by placing an index.html file into the folder for any of my sites. I think the code where index.php is replaced with index.html as the default will successfully give me any .html pages I want for any of those sites, but for the sites that I'd prefer to have continue showing me drupal at the main domain page, I need a different code.

The apache config code above looks pretty good. But I know my live server defaults to php rather than html and as a virtual host customer I don't know how to get it to do otherwise. Does that mean I'm SOL?

James
Newbie here. Really all I want is to make fast web sites mostly, but with some power features and have the ability to customize, not just design, but processes, such as eCommerce features, and subscription based user levels.

I see what you want, but I

dman - April 26, 2008 - 02:51

I see what you want, but I don't see that placing an HTML file into your site folder will be able to help either. Your site folder is not accessed by Apache, it's read by Drupal once Drupal starts up.

The manageable way to do that is, I suppose use Drupal frontpage module, or I dunno ... for what reason did you want this static page anyway?

Changing your drupal .htaccess to look for index.html will work, but will drop you out quickly into whatever index.html is found there. So it's not a fix for multisite at all.
There may be some rewrite magic, but it'll be tricky

.dan.
How to troubleshoot Drupal | http://www.coders.co.nz/

...manually converting

markgriffith - May 9, 2008 - 07:18

So Dick,

how _would_ you convert the static HTML site to Drupal manually, and why make such a conversion [manual or otherwise]? For speed? I have this challenge with a couple of small sites which I could easily do manually if I understood the process.

Is there a gallery of websites done in Drupal somewhere, alongside the code? That would be really useful.

Best wishes,

Mark

 
 

Drupal is a registered trademark of Dries Buytaert.