So I'm completely new to drupal and just installed it on my shared server... and it works! I would like the drupal installation to be invisible to users, so I'm wondering about changing the installation directory name. Right now my site structure looks like this.

www.mysitename.com/drupal_5/node

that is a pretty nasty homepage name, and the drupal folder name is completely unrelated to my site and I'm afraid it will confuse some users when they look at the address bar to see where they are in the site. So I guess I'm wondering a couple things about site planning and structuring.

If I change the name of the drupal folder now that it is installed... will that mess anything up? Do most Drupal users leave this folder or do they change it? Is there a way to keep the drupal installation in still in it's own folder but have content display on the front page of the site... so the url simply looks like this:

www.mysitename.com

Thanks for your help!

Comments

lomz’s picture

I have moved my drupalinstallation a couple of times, with out problems.
But why not move it to docroot?

----------------
Vindstille.net | Gravide studenter mer friske enn andre gravide?

meshackdotcom’s picture

No specific reason to move it to the root... except that it seems like it is a good idea to keep the installation segmented from the rest of the site and away from traditional folders like my cgi-bin, images, scripts and other whatnot that I have traditionally used in web-building. I don't know if Drupal will make those traditional folders obsolete or not, I'm a brand new user. And I don't know if I will want to install other third party scripts.

lomz’s picture

Then just rename the folder to what ever you like

-----------------
Vindstille.net | Gravide studenter mer friske enn andre gravide?

VM’s picture

The method that has worked for me in past is below:
There may be an unneccessary step of two , but I prefer safe over sorry.

If using clean urls, turn them off
if using page caching turn it off
if using css aggregation turn it off
clear you brwoser cache
clear your DB cache tables
rename the folder
turn clean urls back on (if in use)
turn page cacheing back on (if in use)
turn css aggregation back on (if in use)

also note that if you set up a $base_url in settings.php you will have to alter this to reflect the new structure.

Tutunkommon’s picture

Reference this thread:

http://drupal.org/node/474674

Make sure you verify everything after the change, because you may end up having to go back when things break...

michellezeedru’s picture

I changed a folder name for my drupal installation, and everything seems to work fine except for one big problem. I can't log in. When trying to login, I get redirected to an Access Denied page when in new folder named site. If I change the folder name back to the original, I have no problems logging in. I even created a new account and tried that, to see if it was a user #1 issue, but it's not. No matter what I try, once I change the folder name, I can't log in. Everything else is perfect.

------------

Follow-up, in case anyone else is looking, I found the problem. In the settings.php file there was a line $cookie_domain = that needed to be set to the new folder name.

Denver Dave’s picture

I'm researching the same issue. What is the best folder to install drupal into and how to do it.

1) From an organization standpoint and to be tidy, it is awfully nice to have all the drupal stuff under a drupal directory and not mixed up with any other stuff at the document root.

2) After uploading the compressed file, after expanding it, the files are automatically placed in a drupal_xx directory. I rename it to drupal, but don't know how to uncompress the files into the document root and seems like quite a task to move all the files to a different level. Wonder how others are physically installing to the document root?

Thanks.
Dave

gary325’s picture

I too have a site which is running fine and want to go live with the proper url.
This seems like such a normal operation that the great documentation on drupal.org would cover this. But I too search for "redirect" "dev to live" and all I get is move this to that, edit .htaccess(?) and you're good to go!!

So I want visitors to see the root domain/url in the address bar.

www.mysite.com

I have Drupal installed into www.mysite.com/dev (using SimpleScript on Hostmonster)
The domain root directory has a bunch of other stuff in it and I would not want to litter it with all the files Drupal requires.
But, if I have to , I will.
Now if I move all those files there, how do I successfully get all the other stuff in Drupal to work properly?

VM’s picture

options

on your server change your document root to point to yoursite.com/dev
open settings.php and add your url to $base_url

open .htaccess and read it. Specifically where it addresses those who have drupal running in a subdirectory.

move all files to new location, clear cache tables and you should be good to go provided you did not employ any module or any HTML that uses absolute urls.

Now, you've a wrench in there. Using a host installer may not provide you with the ability to move the site. I can't say one way or the other. IMO, a best practice is to use host installed script to test a site, and use drupal's native installer for a production site when the decision is made with reference to which script to build with. No telling how a host script or 3rd party script affects the way drupal installs.

Denver Dave’s picture

Changing the document root, will let drupal load from the domain name. However, seems like the basic issue is with the drupal and many other open source applications philosophy of being the only or at least primary application. Let's say we are running half a dozen applications. For example let's say we are running:

drupal
phpbb
lime survey
utility x

with several of the applications using similar folder names like "includes" and "themes".

What would be really nice is to be able to pick one and place a copy of its index.php into the document root and let the index file be smart enough by specifying an install directory variable to know drupal (or any other application) the at the actual application was one level down along with all the other applications.

I'm not sure whether to

(1) move drupal up to the root and clutter up the root, not knowing for sure that drupal will even be the front door application up or

(2) install an other application index.php at the root, perhaps utilizing another CMS to call the drupal application as needed. Seems pretty insulting to me and to drupal.

I've tried moving the drupal index.php up one level and specifying the path for the includes/install.inc. Calls it, but there are other pathing issues and the issue may be extensive.

Anyone else dealing with this or do you always run drupal as the front door application?

Dave

- - - - -
for example:
"Very often, a Drupal website is just one of many tools being deployed on a complex project."
http://www.chapterthree.com/blog/josh_koenig/howo_use_drupal_http_authen...

VM’s picture

on my local machine for development all scripts are in subdirectories.

Once a decision is made as to what the best tool for the specific job is. That is the script that goes in the root of a production site. I don't bridge more than one script together. ie: drupal and phpbb or any combinationn of more than a single script.

If I need two instances of say, drupal to have say, mainsite.com and store.mainsite.com then I use a multisite install of drupal.

gary325’s picture

Thanks for the options.
Now I need a little translation:

on your server change your document root to point to yoursite.com/dev
open settings.php and add your url to $base_url

What do you refer to when you say "Document root"? Is that the top level folder of my Drupal installation?
How does one "point" to yoursite.com/dev?

open .htaccess and read it. Specifically where it addresses those who have drupal running in a subdirectory.

There is no such file when perusing documents in the filemanager provided by Hostmonster. HM does have a short tutorial on this file, but you must create it. Also "." files do not show up in their filemanager.

Using a host installer may not provide you with the ability to move the site.

There is a utility in SimpleScripts that will help in moving or repairing an installation:
Location Sync: This utility should be used if you manually reconfigured your installation to another domain or folder.
I am not sure this will help.

Sorry for such basic questions, but sometimes "change" and "point" and "read" all mean different things to people of different backgrounds. I am helping out a robotics team and they are developing a website. Professional help is out of the question, plus they are learning as they work. Using multiple dev sites has been a good experience for them, so they can "play" and not get hurt!

Thanks to all of the Drupal community for providing such a great product and the support they offer.
I look forward to your response.

Thank you

VM’s picture

a public document root is the folder that is accessed when www.yoursite.com is called in a browser. Two typical naming conventions for this folder is www or public_html though that may not hold true for every possible hosting combination and should be checked with your host managing software of your hosts support documentation, knowledge base, forums, or support personnel.

Drupal ships, from drupal.org with an .htaccess file in every download. if the file manager in use does not show files that start with a . , than you should use another tool to check . Especially if the tool you are using to check, plainly states that you can't see the files you are looking for with it. ,There are multiple no cost tools that can be used for this and like in your hosts knowledge base under FTP. However, there is this lingering issue that looms with reference to the knowledge that you've installed drupal through a script on your host, rather than with drupal itself. If it turns of after using another tool to check for the .htaccess file, that you are now 100% sure you don't have the file. The method that your host chose to install drupal may or may not have something to do with why it isn't there.

I have no idea about SimpleScripts, the ultilities they provide or how they work on your hosting account.

gary325’s picture

I must conclude this topic by giving my solution.
After all the help I received here and all over the forums, I concluded that this is the best way to move a site within Hostmonster. Sorry if this is well known in the community, I had to learn it myself.

So you used Simplescripts to install a test site for Drupal. It is installed in /testsite
In Hostmonster this will be in your html directory
/public_html/testsite
In Simplescripts you will choose its destination as yourdomainname.com/testsite

Now you can fiddle all you want with your new testsite at
www.yourdomainname.com/testsite

Now you want to have your site accessed on the internet via
www.yourdomainname.com

Wander back to Simplescripts and install another instance of Drupal in the root directory (do not enter anything after the / after your domain name.)

Now using their FileManager, delete the sites directory at root
/public_html/sites
You will need to change permissions on the default directory to 777 in order to delete that folder.

Now navigate over to your testsite location. Within the sites directory change the permissions on the default directory to 777.
Now copy the sites directory to its proper place in the root directory and then restore permissions on the default directory to 555.

Now you will access your Drupal installation at
www.yourdomainname.com

There may be some house keeping if you hardcoded and links. Just delete the everything from testsite back, leaving a beginning "/"

You may also want to delete the database that was created during the last installation of Drupal. THe first database will be used.

Hopes this helps.

saviorfromthenorth’s picture

I have tried to move a live site made from drupal to the local dev, so far I made it to disabling clean-urls. But the other links not included in admin still does not work. I have changed the settings.php ($base_url and $cookie_domain) to my local but the links are still broken. I keep on clearing the cache but still the same result. Is there something I'm missing?

VM’s picture

how are you clearing cache?

is the .htaccess file present and acccounted for?

are there any alterations to it?

sibopa’s picture

I know this post is more than a year old. But I just changed folder and think I should share my experience.

to be safe:
backup your stuffs (db and site folder).
clear all caches.
move your site to the new folder or rename the folder.
At this point, you should be good to go.

If some links are still pointing to the old folder, is that your cache is not cleared.
Go back in the admin area. At this point, you may have hard time clearing your cache as the link will be pointing to the old folder. If so, copy the link location by right clicking on the link, then clicking on "copy link location". Paste in the browser address bar and edit it by removing the old folder info on the link. Now follow the correct link location and your cache will clear.

If you used some direct links(what's not good practice), you will have to manually fix them all.

if you set base url in settings.php, you will have to correct it as well.