Here's another 'so-basic-it's-probably-asked-1000-times' question... but it's also one of those items with no noteworthy key words, so my searching is turning up zilch.

I have a setup with several sites. So a given site, like example.com, is in my web directory like this:

Drupal/sites/example.com/

Basic stuff. Now, I also have some old, static web pages from the old, pre-Drupal example.com, that I want to make accessible. All in a directory called "old", full of static files like "index.htm", "file1.htm", etc. So the address

http://www.example.com/

returns the normal Drupal front page, but

http://www.example.com/old/

returns the static old/index.htm, and

http://www.example.com/old/file1.htm

returns the appropriate static old page. Those static pages won't be integrated into the Drupal DB at all, nor the site theme and menus, but that's fine for my purpose.

My simple question: Where on the web server do I put the directory "old"? Actually placing it inside Drupal/sites/example.com/ doesn't work.

I think a response would help many people. Thank you, helpful ones!

Comments

catch’s picture

it'd be much straightforward to make a subdomain and stick the contents of the folder in there:

http://old.example.com/foo.html

Putting raw html files anywhere in your drupal installation will probably result in page not found errors since drupal controls that directory. You could set something up with a symlink to avoid that, but again, a subdomain is a better option.

Drupalace-1’s picture

You, sir, are fast! Thank you!

I thought about subdomains too; normally, it'd be an excellent solution. In my particular case, not so good – only because there are lots of internal links on my site, and links floating around on other sites, directly to content inside www.example.com/old/ . So I really want to keep the same URLs for those old static files.

Symlinks allow that, and are a working solution. One symlink glitch, though:

I mentioned that I have several Drupal sites within my Drupal/sites/ directory: example.com/, anotherexample.com/, etc.

For my symlink to "old" to work, it has to be placed within Drupal/ , to which all sites are mapped; not within Drupal/sites/example.com/ . Exactly as you noted, the latter results in 'page not found'.

So when someone looks for www.example.com/old/index.htm, the symlink "old" is found within Drupal/, and index.htm is found within the link's target directory. Good.

BUT, if someone looks for www.anotherexample.com/old/index.htm , that will return the same page, too! Even though the page has nothing to do with site anotherexample.com – which, in fact, may be another client's site! Big faux pas.

Of course, there's no reason why someone should try to reach www.anotherexample.com/old/index.htm, but all the same, the fact that it can be done, with content intended for one site appearing on other sites, makes a webmaster uneasy.

I hope the explanation is clear, and possibly of use to others with the same goal. If anyone has another suggestion – or just a way that the symlink will only work for example.com and not anotherexample.com, please let me know! (Maybe those magic .htaccess files?)

catch’s picture

Hmm, can't help you with the symlinks I don't think. Maybe robots.txt to avoid them getting picked up by google, doesn't stop them from being accessed though.

301 redirects (there's even a path_redirect module) to the subdomain would be my personal choice if it was me.

sbarsky’s picture

Please forgive the year+ reply/question, but this is exactly what I want to do, but not sure how.

On the pre-drupal site we had a directory of files that didn't get converted into drupal. We created a subdomain and transferred the files there, but I'm stuck on how to write the .htaccess code so that any attempts at the old files will find them in the new subdirectory.

i.e. www.mysite.com/static/Welcome.html --> static.mysite.com/Welcome.html

Thanks in advance for any clues!

chadj’s picture

If you presently get your traffic from Google then it might be worth your while to not change the existing URLs at all. When you do change them, make sure to add a 301 redirect for each in your HTACCESS file.

>> Actually placing it inside Drupal/sites/example.com/ doesn't work.

That's odd. Drupal's HTACCESS file specifies that if a static file exists, it is opened instead of Drupal. You should be able to place static files pretty much anywhere. As I understand, ImageCache depends on this behavior.

- Chad

Drupalace-1’s picture

"That's odd. Drupal's HTACCESS file specifies that if a static file exists, it is opened instead of Drupal. You should be able to place static files pretty much anywhere."

Really? I had hoped, though didn't expect, that Drupal would indeed do that for me... but sticking with my example, placing "old/index.html" inside my "Drupal/sites/example.com/" directory, and trying to get to "www.example.com/old/index.html", most certainly yields nothing but "page not found". : (

But, your comment gives me hope that some tweak will get that working for me.

LIQUID VISUAL’s picture

Can we use .htaccess to allow automatic display of index.htm in www.example.com/old (directory under drupal install) so that someone will see the index file if they only enter

http://examplecom/old

and not the file name.

Can this be made the default setting for any directory under the drupal install that is not a drupal system install, ie. for old1, old2, old3, etc.

Thanks

Chris Brown

Check out the Mooney's Bay Webcam, at http://liquidvisual.ca

Check out the Mooney's Bay Webcam, at http://liquidvisual.ca

bAcKuP-dupe’s picture

Here is one possible solution:
Strip the old HTML pages of unnecessary tags such as etc... also convert links and image addresses to full hyperlinks... this can all be automated with a search and replace program.

Then upload them to the server, and then create an article page for each static page, and put the the following code in the body of the article to embed the old page into Drupal:
include('http://you-domain-name-here.com/oldsitefolder/oldpage1.htm');

There is also a module at the following link that may be helpful:
http://drupal.org/node/33531