The URL for my Drupal home page shows as http://www.mysite.com/mysite/ in the browser address bar and I would like it to show as simply http://www.mysite.com
A bit of background - my site is installed on my server in /home/public/mysite as opposed to at just in /home/public/
I have an index.php file in the /home/public/ directory with a PHP script that includes the following to point to the sub-directory
header("HTTP/1.1 301 Moved Permanently");
header("Location: http://www.mysite.com/mysite/");
I have the site installed in /home/public/mysite because I use one test server and put various sites in the www directory on it in separate sub-directories IE: www/mysite and www/mysite1 and www/mysite2, etc.
If on the production server I just put the site in the home/public directory then some file references do not work and need to be changed from the test server to production server. Naturally I want to avoid that.
So what I want to know is if it is possible to keep my production site at NFSN in /home/public/mysite but have the URL in the browser show my home page as http://www.mysite.com and not http://www.mysite.com/mysite/
Is that doable?
TIA
Steve
Comments
This looks similar: Migration
This looks similar: Migration from a sub-domain (test domain). Consider using subdomains, like preview.mysite.com .
You said to consider using
You said to consider using sub domains - Do you mean for my production site or test site? My test site is on a local machine.
TBH - you should probably
TBH - you should probably bite the bullet and physically move the site to the proper location.
However, to answer your question - the easiest way would be to use a quick and dirt dirty htaccess rule.
I can not in any way guarantee that this will work OOB - but you should be able to play with it and make something happen.
The basic premise is that you want to strip the subdomain from the url.
This needs to go into an htaccess file in your domain root ! Not in the drupal root htaccess file.
so all links like mysite.com/subdomain/page would be accessible at mysite.com/page
Is the proper directory for Drupal the Root directory?
Is the proper directory the root directory?
I'm starting to think maybe I should change what I am doing on my test machine to make it conform to best practices.
Should I change all all my production sites so that they are installed in root instead of /root/drupal or /root/ mysite and then use htaccess or Virtual Host - VHost on my test server.
Does that sound right?
Well you know - it''s up to
Well you know - it''s up to you.
Will it work the way you have it? Totally, you can make anything work if you are willing to put in the extra time to configure it.
With that little htaccess snippet you should be golden - and as long as you have AllowOverride and Directory Indexes enabled you shouldn't have any problems at all.
Test site
For the test site, as some kind of preview for the customer. That's the easiest way to get things done.