Hi. Searched around the forums and tried similar posts but did not work. I upload several drupal sites into subdirectories to a shared hosting server ( @ network solutions) to serve as demo sites for clients. One of the drupal sites, my own personal website, also resides in one of these subdirectories. I wish to have my domain transparently resolve to this folder. I have set up the .htaccess file in my root directory like this...
RewriteEngine On
Options +FollowSymlinks
RewriteBase /
RewriteEngine On
RewriteCond %{HTTP_HOST} ^mydomain\.com$ [OR]
RewriteCond %{HTTP_HOST} ^www\.mydomain\.com$
RewriteCond %{REQUEST_URI} !^/mysitedirectory/
RewriteRule (.*) /mysitedirectory/$1
When i visit www.mydomain.com, my personal site displays as it should. However, when I click on any link, the url displays in the format www.mydomain.com/mysitedirectory/"page" instead of just www.mydomain.com/"page". Clicking on this usually either throws server errors or clicks back to the front page of the site.
PS. I tried setting the base_url in settings.php to "www.mydomain.com", but this threw errors when I visited the domain.
Thanks in advance.
Comments
subscribing...
subscribing...
Have you read through this:
Have you read through this: http://drupal.org/node/520700 ?
Your situation looks very similar to what I went through, described by that link above.
-Blake
www.BlakeSenftner.com www.3D-Avatar-Store.com
Getting page not found error
I followed the tutorial and now I get a "page not found" error when accessing www.mydomain.com. There are no styles and no links available. I tried different combinations of modifiying the 3 files (.htaccess in root, .htaccess in drupal folder, and settings.php) but all combinations recieved some sort of server error.
Got it working!
After hours of confusion, I finally found a configuration that works for Network Solutions and redirecting a domain to a drupal subfolder using .htaccess in root folder, .htaccess in Drupal folder, and settings.php.
This is the doc root .htaccess file..
I left the /drupal .htaccess file alone, besides uncommenting and modifying the following line.
In settings.php, I uncommented the base_url and changed to..
What a learning experience! Thank you for your help.
Nice one! But still one question...
Your drupal installation is located in http://www.mydomain.com/drupal
And http://www.mydomain.com will act as if the subfolder is the root of that domain.
Will it still be possible to access the site by using the original url of the installation (http://www.mydomain.com/drupal)?
Did they become clones? Or is http://www.mydomain.com/drupal replaced by the domain url?
Thanks, you help me a
Thanks,
you help me a lot!!!!
I solve the problem!
:-)
I tried this, but it wiped
I tried this, but it wiped out my CSS. I am working in Drupal 7 though. Any thoughts?
You are right,I had problem
You are right,
I had problem aslo,
I solve that like that.
Create a new .htaccess file and place it in the web root with the following code:
( replace "drupal7" to your subfolder name )
Now you need to change 1 more line in sites/default/settings.php.
Look for the $base_path variable, uncomment it and change the value to your domain.
You're now done!
I am not a Genius I found that here: http://kahthong.com/node/74
Good luck
Great Job,
This worked on godaddy....
Thanks!
Thanks!
Sustain open source projects on Gratipay
Worked like a charm
Perfect. Thank you :)
Thank you,
Tanzeel