Currently I'm testing out/configuring drupal on my site in a subdirectory, while my old site stays in the root of my html directory.
Is there an easy way to move drupal so the index is in the /home/me/html directory, while all the other files stay in /home/me/html/drupal?

Sorry if this is answered in another post, but I couldn't seem to find it.

Comments

ezheidtmann’s picture

... while all the other files stay in /home/me/html/drupal?

I'm not really sure what you're trying to say. If you mean that the front page appears at / and the second node appears at /drupal/node/2, I don't think you can do it. Frankly, I don't see why you would want to do it.

anglophobe’s picture

Currently I'm using wordpress.
My wordpress index file is at http://domain.com/index.php and all of the config files and such are in the wordpress directory.
I'm a fan of clean directory structures.
I'd like to do a similar thing with drupal.
So, the drupal index.php page would be in /home/me/html and it would reference /home/me/html/drupal
If that doesn't work, I can just move the entire directory contents up one directory right?

phatPhrog’s picture

media girl’s picture

If you have the ability to do this, why not create a subdomain (subdomain.yourwebsite.com) and install Drupal there. Then, once you're up to speed, have your main domain point to the subdomain (or mirror it) so that visitors to your main domain see what you've built on the subdomain.

--
mediagirl.org

ezheidtmann’s picture

Do you want URLs to be at example.com/drupal, or the included files in /drupal but the URLs at the root level?

The second is rather difficult and would likely require a lot of code changes. The first is just about what you've got now.

symtym’s picture

I understand the orginal question, but don't see an answer that makes sense to me (at least).

If I presently have Drupal 4.6 set up with /home/me/html/drupal/index.php and I want to move index.php to /home/me/html/index.php and leave all the other Drupal files in /home/me/html/drupal to maintain a "neat" html directory what adjustment to what file will accomplish this.

With WordPress the adjustment is very straightforward to move the index.php at /home/me/html/wordpress/index.php to /home/me/html/index.php with the remainder of the WordPress files remaining at /home/me/html/wordpress. You just adjust the index.php with the move from ./wp-blog-header.php to ./wordpress/wp-blog-header.php.

Is there a similar adjustment that I'm just not seeing? TIA. Apologies if this has already been covered, but this seemed the closes thread to my question.

sepeck’s picture

You can't just move index.php file without rewriting it. WordPress is not a complex CMS with a lot of interdependancies. WordPress is a product focused on blogging, while Drupal can do blogging with other stuff.

The adjust you need to make is in your Apache htaccess file. Look at the one downloaded with your Drupal install for the examples.

-also http://drupal.org/node/4810

-sp
---------
Test site...always start with a test site.
Drupal Best Practices Guide

-Steven Peck
---------
Test site, always start with a test site.
Drupal Best Practices Guide

symtym’s picture

Its .htacess time.

likoma’s picture

I think I have a similar situation, but I'm hoping it's even simpler.

I have a test Drupal install (4.6.2) in domain.com/home. The old site is at domain.com. I'm ready to go live and I'll just delete the old site and move Drupal from domain.com/home to domain.com.

I'd rather not do redirects or mess with .htaccess. I just want Drupal in the root directory, the whole thing, with its directories and everything.

I see in /sites/default/settings.php there's this:

$base_url = 'http://www.domain.com/home';

Is the whole process as easy as:

1.) Change that line in settings.php to:

$base_url = 'http://www.domain.com';

2.) Drag all folders sitting in /home/ to domain.com?

Thanks for any advice before I do this!

There are maybe 50 entries in the current test site.

- Bradley

likoma’s picture

Actually, while I'm asking, how can I avoid this in the future? There's usually an existing site up at domain.com (usually index.html or default.html or whatever). So could I somehow allow the old site to function while I work on the Drupal site until it's ready to switch?

ezheidtmann’s picture

There are many ways to do this.

You can either set up a site on your home machine or put one in a subdirectory on your hosting account. The former is much more powerful and generally better in the long run, but it takes more work to get started. If you do the latter, all you need to do when you're ready to switch is move the files and change the $base_url variable in settings.php.

I went looking for some info in the handbook, but I couldn't find anything.

ravenpix’s picture

I can't believe that this question hasn't a reply that goes to the point!
I'm also trying to have Drupal working on my site's root:

http//www.mysite.com

That's easy, of course! But the question is:
How to manage mysite.com with Drupal installed in a subfolder?

Eg. (this is what I want):

http://www.mysite.com/drupal .....Here's Drupal

http://www.mysite.com .....Here's my site

Why I don't want to install all the drupal directories in my site's root? It doesn't matter, I'm trying to know if this is possible ...

Thx in advance!

.................
Ravenpix
.................

sepeck’s picture

Read the htaccess file for examples. This is a webserver setup question more than a Drupal one.

The default examples used to be set for using Drupal in a sub directory, but people complained that it was to confusing so it was changed.

In the mean time, I refer you to the handbook page that may help a little as well in addition to the htaccess file in the download.

-sp
---------
Test site, always start with a test site.
Drupal Best Practices Guide -|- Black Mountain

-Steven Peck
---------
Test site, always start with a test site.
Drupal Best Practices Guide

charlesp’s picture

Yeah, you know, I like Drupal a lot. I downloaded it to a test directory on my website and poked around it a bit, trying to get the hang of it. Before I knew it, I'd converted my entire old site over to the drupal I had in my subdirectory.

I thought Well heck, I'll just copy everything over to the root so that I don't have to go through a bunch of re listing my url and all of that business.

My site worked like 10 minutes after that and started crumbling. Weird errors, strange layout, things disappearing or showing up wrong..it was a mess. I wound up having to wipe the whole thing out and start from scratch. It was a real chore (and a testament to how much I like this software) but Im 95% back up to speed now. Still a few things to add. Anyways, when I ran into problems I came here and searched high and low for help on transferring from one directory to the root directory and couldn't find anything...til now and now Ive already re worked everything.

In the next version of the handbook I hope there's a section for idiots like me that installed Drupal in a subdirectory and then transfered it over to the root directory so that no one else looses their website!

sepeck’s picture

The only thing you need to change in a transfer is the baseurl in the settings.php file and any htaccess file rules you have set in regards to a sub directory. (This assumes file permissions are correct).

I have transfered a number of sites over and over again. To and from subdirectories and site roots. If you have a backup of your database, then you should be able to restore it. I suggest reading th ebest practices link in my sig.

-sp
---------
Test site, always start with a test site.
Drupal Best Practices Guide -|- Black Mountain

-Steven Peck
---------
Test site, always start with a test site.
Drupal Best Practices Guide

sito-1’s picture

I have read this whole thread and also looked up the Handbook at the place indicated and I am no wiser as to how to do it...

What I have:

1. Installed drupal in mysite.com/drupal.
2. Would like to access Druapl from mysite.com directly.

What I have done:

1. Modified the .htaccess as suggested in Handbook.
2. Modified base_url as suggested in Handbook.

My question is which file (or both) out of index.php and .htaccess do I need to copy to the root directory?

Thanks!

here’s picture

this is a widely requested open issue. I'm linking all threads here: http://drupal.org/node/22336 , which will hopefully gather the troops ;). Please reply on /that/ thread, not this one.

(oh, and me too!)

sepeck’s picture

the issue. To move an install, just move ALL THE FILES to the new driectory structure. Modify the settings.php (baseurl) and the htaccess file as appropriate to the new location.

Everything else is relative to this information uless you have hard coded it somewhere for some odd reason.

You do not move one file. Drupal is a CMS. Most of the files are needed o rit just all breaks. People keep giving the correct answer.

-sp
---------
Test site, always start with a test site.
Drupal Best Practices Guide -|- Black Mountain

-Steven Peck
---------
Test site, always start with a test site.
Drupal Best Practices Guide

seadog’s picture

I have done all of the above steps, and am still not able to get this to work. I know it's not that difficult, but I've gotta wonder what I'm missing.

I set up the Drupal site in a subdirectory callled "cms." The owner of the site wants to lose the 'cms' portion of the URL. So I:

1. Copied the entire content of the 'cms' folder to the root folder;
2. Reset the base URL in the settings file to elminate the 'cms';
3. Have looked at the .htaccess file (now in the root folder), and have noodled around in tthere, but cannot find what might need to be to modify there (even after reding through your Best Practices Guide).

What exactly needs to be tweaked in the .htaccss file? I'm sorry to say that "as appropirate" isn't all that helpful.

Any further clarification would be very welcome.

sepeck’s picture

htaccess is an Apache config thing.

Look here: here for a copy of the original htaccess file

If you had Drupal in a sub directory, then you or someone modified it at some point

At a guess, yours looks something like

  RewriteEngine on

  # Modify the RewriteBase if you are using Drupal in a subdirectory and
  # the rewrite rules are not working properly.
  #RewriteBase /cms

and you want it to look more like the original which assumes Drupal will be in the root folder.

  RewriteEngine on

  # Modify the RewriteBase if you are using Drupal in a subdirectory and
  # the rewrite rules are not working properly.
  #RewriteBase /drupal

Though I am not sure why the guy running sites on IIS is answering this one. :)

-Steven Peck
---------
Test site, always start with a test site.
Drupal Best Practices Guide -|- Black Mountain

-Steven Peck
---------
Test site, always start with a test site.
Drupal Best Practices Guide

seadog’s picture

Thanks for the quick reply, but that didn't do it. Now I get a really fun error message:

warning: call_user_func_array(): First argumented is expected to be a valid callback, 'node_page' was given in /home/cawrecyc/public_html/includes/menu.inc on line 354.

Any (nice) thoughts?

cog.rusty’s picture

Hmm... if you dumped everything into the webroot, the default .htaccess should work ok, with the RewiteBase commented out. And if it worked before in a subdirectory, then the problem must be some small detail.

Is your settings.php in 'sites/default' or in another 'sites' subdirectory with a different name?

And did you by any chance leave a trailing slash in the base url in settings.php?

seadog’s picture

at least with those files.

Rewrite base is commented out (and it did work in the subdirectory);
settings.php is in sites/default;
No trailing slash on the url in settings.php.

I've even reloaded the default .htaccess file in case screwed anything up in there, but nothin' doin'.

cog.rusty’s picture

What else could it be...

Is the old cms directory still there with the same name? Since the error message you are getting is coming from Drupal, at least make sure that it does not come from the old one.

Had you done any tricks to redirect to the cms directory when it was there, so that the visitors wouldn't have to type 'cms'? Any leftovers from that?

I am not trying to be helpful, I just like troubleshooting mysteries :)

seadog’s picture

I appreciate your inquiry, even if it is just idle interest.

A parallel site is up there still in the cms subdirectoy. The site owner hated the old site so much he wanted to pull the trigger on the new one, despite my warnings of potential problems.

No redirects in the cms folder. Nothing fancy. All I did before was have the index.html file redirect to the cms folder. And the error message indicates the files on the root, not in 'cms'.

It's not this complicated, right? I'm just missing something really basic, yeah?

cog.rusty’s picture

Here is something which might help (or not)

http://drupal.org/node/23030

warning: call_user_func_array() [function.call-user-func-array]: First argument is expected to be a valid callback, 'node_page' was given in D:\Web\GAP2\drupal-4.6.0\includes\menu.inc on line 354.

They say that the node module was not loading, they report that it was cured by itself and they blame throttling.

seadog’s picture

Now I get a different error message. This is good! I'll try to run this down then report back here with what I find.

Thanks!

seadog’s picture

Finally got the solution.

First, the embarrasing stuff. I was getting errors because I had not fully ported modules as I had thought. Might have been due to server time-outs . . . or just plain operator error.

Once I got rid of the error messages, I was back at square one: home page appears, but nothing else. Finally decided to try adding in "?q=" ionto the URL, and, voila, pages appeared. Once I discovered that, I could get in to admin > setings, and enable clean URLs (this was necessary as the site nav is hardwired).

Only, now I was getting the error that I needed to talk to an admiistrator to be able to use modRewrite. This didn't make sense, as it was working when the .htaccess file was in the subdirectory.

It turns out that my ftp program (Dreamweaver) was corrupting the .htaccess file. I wasn't able to get Fetch to find it, so I modified the file name by removing the "." at the beginning of the file name (htaccess), uploaded it, and changed the name back. And that did the trick.

So, ultimately, it is as simple as changing the settings.php file and .htaccess file . . . but there are, for some of us, a few steps in between.

Thanks to all who helped.

ArunK’s picture

I am converting a static html site to drupal for someone, which is currently setup like: www.domain.net.

I would like to have the new drupal powered site at www.domain.net (after copying all html files/images) or www.domain.net/content and the test installation of drupal at www.domain.net/drupal.

The host is Earthlink, I don't know if they have cPanel or phpMyAdmin. They may have to move their site to a new host.

So the settings.php fiel would look like:

$base_url = 'http://www.domain.net';
or
$base_url = 'http://www.domain.net/content';

and the test installation
$base_url = 'http://www.domain.net/drupal'; correct?

When I am ready to copy the site and move it from http://www.domain.net/drupal to http://www.domain.net, the only thing I have to change is the url info in settings.php from the test installation and restore the database?

syoumans’s picture

I had a site where I hadn't switched the domain over yet. I was working out of www.provider.com/~mydomain/ for a while and then I transferred the host name and created a subdomain for my drupal install (test.mydomain.com).

old sites directory:
default/
provider.com/

new sites directory:
default/
test.mydomain.com/

When I went to view the site at test.mydomain.com, a story I added displayed but no theme and no menu and no error message. Weird. I searched around drupal.org and found this thread, but my issue seemed different so I opened up drupal's database and started looking for hardcoded paths.

Inside the system table were some entries that include paths to modules:
sites/provider.com/themes/chameleon/cha...
sites/provider.com/modules/tinymce/tinymce...
sites/provider.com/modules/civicrm/mod...

It seems that some modules and themes store path information that is site specific thus making it more complicated to move an installation from directory to another. When I changed provider.com to test.mydomain.com everything started working just fine.

Is this expected behavior? Did I do something wrong/unexpected to cause it? Or should these modules/themes play a little nicer?

cog.rusty’s picture

These paths are relative to drupal's base directory. They are produced for all modules and themes which you install under "drupal/sites/sitename/modules" and "drupal/sites/sitename/themes".

I can see how this could be a problem with changing site names. The alternative for more flexibility is to install all modules and themes under "drupal/modules" and "drupal/themes" and enabe the ones you want for each site. The price is a little clutter, of course.

ideviate’s picture

hi,
i moved my site from subdir create to the root. how come the links for the old configuration works, for instance; www.example.com/subdir/?q=node/39. but the interesting thing is it does only work both for ?q= not the clean urls. how can i fix this?

powered by Drupal www.universideliyiz.biz

joachim’s picture

This thread shows up in searches, so I think it's a good idea to add more up-to-date information to it :)

Using Drupal 5.1, I've just moved my entire Drupal folder to a subfolder, and back again to the root folder of my webserver. It worked fine in the subfolder at the new URL, and still fine back at the root folder and the main url.

Success’s picture

Can we install drupal in

domain.com/drupal

but remove the /drupal/ portion from the url and serve the pages from root?

So that

domain.com/index.php

shows the drupal site?

Can this also be done on a multi sites setup?

joachim’s picture

For the answer to that, see http://drupal.org/node/131906 -- but I don't know about multiple sites.

Success’s picture

Thanks.

I installed drupal in /drupal/ folder. With this htacess, I can access drupal from the root directory now.

But how to remove the /drupal/ portion from the url?

More here http://drupal.org/node/22336

joachim’s picture

This thread is about moving the entire drupal folder to another folder.

cog.rusty’s picture

This is a very old question, and from all that I have read I believe it is not possible to install Drupal in a subdirectory and access it as if it was the web root without displaying the subdirectory -- except if you can do (1) below.

Certainly not with apache rewrites, because they actually change a request for the web root to a request for a subdirectory, and that subdirectory is displayed.

Possible solutions:
1. Make Drupal's subdirectory the web root of another domain, if your hosting setup allows that, and use that other domain instead. Some hosts such as site5.com make this very easy, using domain pointers which make any subdirectory you want a web root for a new domain.
2. Try using a bunch of symlinks in the web root which point to the important files and subdirectories of Drupal. This is tricky to work, and the symlinks already make the web root messy, which defeats the purpose.
3. An extended redesign of Drupal so that it only has an index.php and a .htaccess file in the root and everything else in a subdirectory. This is not available.

joachim’s picture

Works fine for me with Drupal 5.1
I have Drupal in a subdirectory and with an .htaccess in the root folder I can access it as if it were in the root -- at www.example.com instead of www.example.com/drupal.
Details in the other thread.

joachim’s picture

Aw.... crud.
I just realized what you mean -- the site is visible at www.example.com, but Drupal still generates its own URLs with Drupal in them. :(

cog.rusty’s picture

Yes... the Apache rewrite changes the user's request and adds "/drupal" to it.
That's how the site is accessed.

CheckeredFlag’s picture

See my comments here.

Success’s picture

Hi,

You wrote RewriteRule ^/(.*) /drupal/$1 [L]

I can't get that to work.

But these 2 seems to work.

RewriteRule (.*) /drupal5/$1 [L]

RewriteRule ^(.*) /drupal5/$1 [L]

I am not sure about these. Which is right? Will there be any conflicts with modules or files?

Also, if I install a forum and wordpress in /forums/ and /blog/, I think this method will cause a problem?

Root
- /drupal/
- /forums/
- /wordpress/

And, can we do this in a multi site setup?

astra’s picture

I also like to know if this configuration supports multisites.

cog.rusty’s picture

It depends, what multisites exactly?

Multisites work by comparing the requested URL with the names of the settings directories under /sites.
This apache rewrite adds "/drupal" to the requested URL.
If the multisites identification does not conflict with that, it might be ok. It may take some testing.

CheckeredFlag’s picture

Well, I'm assuming the installation is in "/drupal". If you have it in /drupal5, then it would need to be changed accordingly. Or perhaps you have RewriteBase defined which then changes the URL content.

Your two examples are equivalent since RewriteRule matches against the entire URL (with the "http://www.example.com" removed). The latter may be preferred for clarity and potential efficiency since it states that the regular expression must match the beginning of the URL.

I too am using Drupal in a mixed environment, merging it into my site with existing files along side Drupal. This requires a more complex .htaccess file; here is what I'm using:

   # Rewrite base to strip leading /
   RewriteBase /

   # Redirect root dir to Drupal top page
   RewriteRule ^$ /drupal/index.php [L]

   # Skip existing non-Drupal files or directories
   RewriteCond %{REQUEST_FILENAME} -f [OR]
   RewriteCond %{REQUEST_FILENAME} -d
   RewriteRule ^ - [L]

   # Existing Drupal files/directories (e.g. images, css)
   RewriteCond %{DOCUMENT_ROOT}/drupal/%{REQUEST_URI} -f [OR]
   RewriteCond %{DOCUMENT_ROOT}/drupal/%{REQUEST_URI} -d
   RewriteRule ^(.*)$ /drupal/$1 [L]

   # Otherwise rewrite as a Drupal query (Clean URLs)
   RewriteRule ^(.*)$ /drupal/index.php?q=$1 [L,QSA]

I'll walk through this a section at a time.
This strips the leading / from a URL (e.g. /some/dir/file.php -> some/dir/file.php):

   # Rewrite base to strip leading /
   RewriteBase /

This redirects the empty URL (formerly "/") to the Drupal top page:

   # Redirect root dir to Drupal top page
   RewriteRule ^$ /drupal/index.php [L]

This checks to see if the requested URL already exists (all non-Drupal files/directories).
(The '-' in the RewriteRule means don't perform any substitution.):

   # Skip existing non-Drupal files or directories
   RewriteCond %{REQUEST_FILENAME} -f [OR]
   RewriteCond %{REQUEST_FILENAME} -d
   RewriteRule ^ - [L]

Since the URL doesn't exist, check to see if it exists in the Drupal directory - if so, use it. Had to play some games here to split up the URL and insert "drupal" in the middle. The DOCUMENT_ROOT may not accurately reflect the actual file path - especially if aliases have been used. You may need to use the actual path to the drupal directory instead:

   # Existing Drupal files/directories (e.g. images, css)
   RewriteCond %{DOCUMENT_ROOT}/drupal/%{REQUEST_URI} -f [OR]
   RewriteCond %{DOCUMENT_ROOT}/drupal/%{REQUEST_URI} -d
   RewriteRule ^(.*)$ /drupal/$1 [L]

Finally, since none of the above conditions were satisfied, assume it to be a Drupal clean URL that needs to be converted into a query:

   # Otherwise rewrite as a Drupal query (Clean URLs)
   RewriteRule ^(.*)$ /drupal/index.php?q=$1 [L,QSA]

Note that all of this assumes that Drupal is the default application and is all rather fragile. It will break if Drupal uses the same path of an existing application. For example, /forums/... and /blog/... as in your environment would be reserved paths that you could not use in Drupal.

I've been using this for several weeks and it seems to work without a hitch so far.

I haven't tinkered with multi-sites yet so I'm not quite sure how they work so I don't know how this would affect that environment.

david007’s picture

this is a widely requested open issue. I'm linking all threads here: http://drupal.org/node/22336 , which will hopefully gather the troops ;). Please reply on /that/ thread, not this one.
____________________________
Insurance Center

Fred Smith’s picture

I had a Drupal 4.7 site in the root directory and a Drupal 5.11 site in a Drupal directory. I backed up everything before I started.

I deleted the Drupal 4.7 site, then moved the Drupal 5.11 site into the root.

In sites/default/settings.php I changed their generic example to my site's name
$ base_url = 'http://cincyblues.org';

Then in the .htaccess file in the root directory, I uncommented the rewrite base/ line. Uncomment means to remove the # sign.

Like so:
# If your site is running in a VirtualDocumentRoot at http://example.com/,
# uncomment the following line:
RewriteBase /

At this point, the home page was showing up, but if you clicked on any navigation links, it would just go back to the home page. The url was showing up as http://example.com/drupal/node/8

There was a wierd thing I noticed when I was moving files. I couldn't delete the old .htaccess file in the root directory. There was also an .htaccess file in the Drupal directory. Once I uncommented the rewrite base/ line in the .htaccess file in the Drupal directory, everything started working fine.

Does anyone see a problem with having 2 .htaccess files? When I deleted the .htaccess file in the Drupal directory, the site said Page Not Found, so I put it back in a hurry, and now it's working again.

Should I ask my website host to do something with the files so there aren't 2 .htaccess files?

meisdug’s picture

Hello, I too have had some difficulty moving my drupal installation from mysite.com/drupal to mysite.com. I've spent many hours troubleshooting and just being frustrated. Now that I have it fixed, I'd like to share some tips.

One thing I would recommend is to switch to a default drupal theme if you are having trouble. I switched to garland and it started working. I switched back to my custom theme and it was working, but only on the admin page I was on. The front page still wouldn't work at all, just a blank white screen.

I'm using cpmfetch (http://cpmfetch.fistfullofcode.com) to extract some images from my coppermine photo gallery for display on the front page. I hadn't updated the link in the cpmfetch block. This one problem somehow prevented my entire front page from displaying at all. Fixed that and it works perfectly now.

So, to sum it up, yes, the posts here are correct that you only need to change settings.php and .htaccess to move a basic drupal installation. But if that doesn't work for you check the "other stuff" you have added to your page. Just a simple broken link can obviously cause some major unexpected problems.

maartenr’s picture

I guess sooner or later a lot of us end up having this problem.
Everything has been installed in www.example.com/drupal in stead of www.example.com. However, to publish your site you want everything in www.example.com
How to get this done?

In the posts above I found the key elements to use.
I only write all this down in detail for other newbees like me to get through this problem.

My story and details:
A week ago I installed Drupal version 6.13.
Furthermore I use a utility (provided by my hosting provider) called 'DirectAdmin' for the management of files, e-mail, settings etc. of my account.
Everything written in this post like moving, renaming and editing I have done with DirectAdmin.
For uploading I am a happy user of the public domain program Filezilla.
I think you can do everything I've written here as well with Filezilla too, in combination with a program like Notepad.
The theme I use is Garland and (the 'best'?) module I could find for for handling photos is IMCE.
As editor I use FCKeditor.

Now, when I installed Drupal for the first time, the install program within DirectAdmin suggested to install in the subdirectory /drupal.
I could have used the root, /, but as I got a warning (newbee.....) I followed the suggestion of installing in /drupal.
Also, in DirectAdmin is something one can use for redirection of url's, so I thought I could use that in the future.... (boy, I was quite wrong there. More about that later).
In my case the root, /, is shown in the filesystem of DirectAdmin as the file ..../public_html; but I will refer to root or / in the rest of this posting.

After a week, having constructed something that I wanted to show to other people, I wanted to use the 'public' name www.example.com.
However, the redirection in DirectAdmin didn't work as expected.
I consulted the hosting provider. He couldn't get it working either and gave me the suggestion to install everything again, but now in the root.
That suggestion didn't provide me with a lot of warm feelings. How to import or redo all the work I had already done? No way....
So I read the forum of Drupal looking for a solution and finally got it working correctly.

The recipe:
1) make a backup of your system in case something goes wrong. In my case, I could use DirectAdmin for that.

2) check if there are files with the same name in / and in /drupal and write them down for referral. I found two, .htaccess and index.php.
Write down the read/write/edit- (rwe-) permissions of these files.
(I can see these rwe-permissions in DirectAdmin, you will have to find out how you can see them in your file system)

3) rename the files with the same name in /, ( in my case .htaccess and index.php) to .htaccess_old resp. index.php_old, so that you will not lose them by being overwritten.
(you never know, you might want to use them again later)

4) write down the rwe-permissions of the files that you are going to edit:
/sites/default/settings.php
/drupal/.htaccess
/drupal/index.php
(maybe you don't have to change the rwe-permissions, but better be sure to have them back later the way they were before you started).

5) now move all the files and folders from /drupal to /

6) by editing the file, change the line in /sites/default/settings.php that shows
* $base_url='http://www.example.com'; into
$base_url='http:/www.yoursite.com';
(I know that looks pretty scary if you are a newbee like me, but it's really not difficult)

7) by editing the file, get rid of the comment sign '#' in /.htaccess so that
# RewriteBase / is changed in
RewriteBase /

8) check the content of /index.php
in my case there was a line with .../drupal/misc/...
So I changed that to .../misc/...

9) check and if necessary change the rwe-permissions of the edited files back to the way they were originally (it wasn't necessary to change them in my case)

10) after this my site almost worked in www.example.com, however the photo (I had just started with the content, so I was glad it was only one photo) wasn't shown.
After I reloaded the photo using IMCE, the photo showed correctly.

After the above steps I could work happily with the site again and could reach it via www.example.com

11) Finally, I wanted to make a new backup.
But... that didn't work anymore: I had to change the backup settings in DirectAdmin.
That was not too difficult, however but goes beyond the scope of this posting.

Success with your change to root!

nimo-dupe’s picture

You can't just move index.php file without rewriting it. WordPress is not a complex CMS with a lot of interdependancies. WordPress is a product focused on blogging, while Drupal can do blogging with other stuff.

free games

Peters196’s picture

Many of the posts here seem to by from people trying to do something out-of the-ordinary.
However, my question is very simple:
I have developed my site on my local computer using localhost.
The base address for the files is c:\inetpub\wwwroot\myfolder\drupal7.4\
such that in that folder if have, for example:
c:\inetpub\wwwroot\myfolder\drupal7.4\includes\
c:\inetpub\wwwroot\myfolder\drupal7.4\sites\
c:\inetpub\wwwroot\myfolder\drupal7.4\scripts\
c:\inetpub\wwwroot\myfolder\drupal7.4\.htaccess etc.
and to assess the website on the local computer I use the url:
http://localhost/myfolder/drupal 7.4 to get to the home page
http://localhost/myfolder/drupal 7.4/user to log in etc.

I now need to upload everything to the server, to my domain called mydomain.com such that I can enter:
www.mydomain.com to get to the home page
www.mydomain.com/user to log in etc

1. Do I need to upload everything in the c:\inetpub\wwwroot\myfolder\drupal7.4\ folder to the root directory of the domain? - Please answer YES or NO, and if No,what?

2. Other than changing the write permissions as described in install.txt and uploading the database is there anything else I need to do?

I have un-commented and set the $base_url variable in sites\default\settings.php

After uploading the files in the way I described, the base url (www.mydomain.com) took me to the install script which allowed me to change the name and password for the database and nothing else.
Since then the base url takes me to my home page (the maintenance screen) which should be showing an image - but doesn't; an clicking on 'login' or 'Register' I get:

Internal Server Error

The server encountered an internal error or misconfiguration and was unable to complete your request.

Please contact the server administrator, [no address given] and inform them of the time the error occurred, and anything you might have done that may have caused the error.

More information about this error may be available in the server error log.

I would have thought that transferring a site from localhost to a server would have been a very common, standard procedure and we are always urged to develop the site locally before going live, but nowhere can I see any step by step instructions for performing this task. All the installation instructions appear to assume you are installing a brand new raw version of Drupal!