By bwooster47 on
I've drupal installed in a sub-directory (because I've many other non-drupal folders at the root of my web site).
Everything works fine, and I've a .htaccess redirect at the root folder to go to /drupal/ so all / requests go to /drupal/ and from there on, the drupal sites settings.php takes care of everything - base_url is set to /drupal/
I would like to remove the .htacess redirect - so, am thinking of creating a index.php or index.shtml at the root of my web site to directly include the contents of the /drupal page.
/index.shtml:
<!--#include virtual="drupal/" -->
Anyone have comments on this? It does work, so wanted to bounce this off others. Will search engines gets confused to have the same page at / and /drupal?
Comments
Symlink or...
I'm uncertain why you would ever need to do this. Drupal operates fine even with other folders in the webroot, they can live side by side with drupal as long s they aren't webpages themselves - which if you are including or redirecting there obviously aren't anyother pages there. Just untar the files, and move all the files in drupal to root. It might be a little disorganized, but works fine. My server uses root to host a bunch of ftp files, and the logs folder, etc. There's no real reason to descend to the next level unless you want root to host another URL that isn't drupal (other URL's that are drupal can use a multi-site install).
If the effect was needed, a better way would be to create a symlink via SSH from /root to /root/drupal an then put the proper entry into Apache. I'm no expert but it seems your way is more server intensive. index.shtml would need to go to apache, to get to index.php only then can the mysql queries hit, the page get created and sent to Apache, again. Symlinks are more like going right to the proper folder, not accessing Apache to get there.
But, I should say that your best argument is "It does work" so obviously you aren't wrong ;) Cheers.
Sam Tresler
http://www.treslerdesigns.com
Redirect
Hi,
You can also redirect your visitors to the drupal site:
(I typed http as ht tp just to avoid to create a valid url.)
Cheers,
Emiliano.
http://www.novayork.com
Thanks
Thanks, Emiliano. I just put that into my root as index.php, and now my Drupal site is live and flying.
NancyDru
Hi Emiliano
Can you explain what I would do with your code and how it works. Please forgive me for being stupid about this; I have my site in a subdirectory and am planning shortly to move it to root so I can use the top level domain name. Does your code just direct visitors to the subdirectory? So then the url for a node (let's say) would be http://example.com/drupal/this-is-a-node-article-example rather than http://example.com/this-is-a-node-article-example?
I'm just trying to figure out if I should use your code or if I should just move Drupal from the subdirectory to root.
Carey
What I did
What I did was put his little code in my root directory as index.php and didn't have to make any other changes. No file moves, directory changes, or code changes. Very simple and straightforward.
NancyDru
parallel install
I had a similar question...
I have a very crude index.php menu page in my existing web root. For trial/demonstration purposes, I put Drupal 4.x in a webroot subdirectory "drupal". I was assuming there would not be any problem later when I moved all of that directory to webroot.
I am now committed to implementing, and I am thinking that I will install Drupal 5 in the web root, but change the drupal index.php to index2.php until I have Drupal more fully configured. I can also have a link on the legacy index.php that will allow people to go to index.php to see/demo Drupal for a few weeks.
When I am finished with legacy menu, I will just change Drupal index2.php to index.php.
Can you see any possible problems with this? It seems too simple to cause problems, but I want to be cautious as I don't think I understand Drupal nodes and such very well (yet!)
Jim
SEO
I'm completely new to website design, and I read a 5-minute article on SEO, and it seems that this would be a bad idea, no?
It seems that this is the easiest way to redirect to drupal sites, but are there any other ways to get the index.php at the top level?
I have almost no idea what I'm talking about.