Forum Moderators: phranque
I have a main domain, maindomain.com.au. My host allows me to have a 'stacked domain' pointing to a folder on my main domain. Under that arrangement I currently have StackedDomain.net pointing to maindomain.com.au/StackedDomain. Under that 'stacked domain' I obviously have further folders and files to access, one of which is StackedDomain.net/craig.
My problems are many, but here's the first.
If I enter the URL "http://www.StackedDomain.net/craig/" then I am directed to the proper file and the browser URL continues to show what I entered.
However, if I enter the URL "http://www.StackedDomain.net/craig" (no trailing slash) then I get taken to the right file, but the browser address bar shows "http://www.maindomain.com.au/StackedDomain/craig/index.htm".
I am assuming the only way to fix this is via .htaccess. Eventually I want to get subdomains working under this stacked domain (I'd rather have www.craig.StackedDomain.net than www.StackedDomain.net/craig, but it seems my host isn't allowing that at the moment). But I want to make sure that the correct domain always appears in the browser address bar.
Has anyone got any ideas?
My current .htaccess file is pretty muddy with lots of things commented out that didn't seem to work, but the relevant lines I am trying at the moment are....
RewriteCond %{HTTP_HOST} maindomain.com.au$ [NC]
RewriteRule ^(.*)$ [StackedDomain.net...] [R,P]
But this seems to do nothing.
PLEASE HELP!
Craig
[edited by: jdMorgan at 2:40 pm (utc) on June 17, 2004]
[edit reason] Removed specifics per TOS [/edit]
The most likely cause of this trailing slash problem is that your host has configured the server with UseCanonicalName on (See Apache core documentation). You could ask them to reconfigure that, and set UseCanoncalName off instead for your 'account' if they are responsive to such requests.
Unfortunately, .htaccess runs too late in the Apache API processing to 'fix' this problem.
Jim
The term 'canonical name' rang a bell, and I went back through my previous attempts at editing the .htaccess. I have found in the past that if I include the line
UseCanonicalName on
in my .htaccess that I get a server error. Is this confirmation that it is already on as you suggest?
Unfortunately my hosting company is about as responsive as a Mac truck underwater. I have been trying to get them to sort this issue out for the last three months, but they keep brushing me off or ignoring me.
Can I then move on to my bigger problems in the hope that you might have some solutions?
Thanks again.
Craig
Here's my big problem.
When hosted on their previous server I was able to have several domains 'stacked' onto my single hosting account. A 'stacked' domain was resolved to point at a particular folder on my main account. So I had a domain called 'example.net' that was pointing to a folder called 'example' on my main account.
With their old server I could configure subdomains within the 'stacked' domains using .htaccess to direct the subdomain to a folder within the subdomain folder. So 'craig.example.net' could be directed to the folder 'example/craig'. With the .htaccess file I could add and delete these subdomains to my heart's content.
Now it's all changed. On the new server they say that this is now "technically impossible". Which strikes me as odd - it worked on their old server, which was an Apache, so why shouldn't it be possible on the new server, which is also Apache?
Now, any attemp to go to 'craig.example.net' gets back a "Cannot find server or DNS Error". So it doesn't even get past their DNS to allow me to direct the request where it needs to go.
I am assuming that this is a simple enough configuration change on their DNS - like allowing for all requests to "*.example.net" to be directed to me. It seems to be able to deal with "www.example.net" as well as "example.net", so why should "www.craig.example.net" be so difficult?
Any words of wisdom I can use when I speak to them next would be greatly appreciated. So far, in two posts, you have provided me with more assistance than my hosting company!
Craig
[edited by: jdMorgan at 4:56 am (utc) on June 18, 2004]
[edit reason] Removed specifics per TOS [/edit]
<semi-wisdom>
Can't post my first thoughts here, but the polite version is,
"Dear hosting company, I am your customer. Your service no longer works for me the way it used to. Please
A) Fix it,
B) Give me my money back so I can get the service I need elsewhere, or
C) Give me a substantial financial concession to keep me here."
(Rhetorical) Do you make money off your site(s)? If so, is it more than $25 U.S. per month? You can get some seriously-competent hosting for $25 per month/monthly or $15 per month/yearly. Cheap hosting is not worth the price. Resonably-priced hosting with good tech support is.
The number of posts here on WebmasterWorld concerning problems that should not exist or that should be easy to fix on properly-configured servers is astounding. The way I figure it, if "expensive" hosting saves me two hours a month in hassles avoided, it's very well worth the cost.
</semi-wisdom>
You should be able to point whatever domains you like at your IP address, and then sort them out using mod_rewrite once the requests reach your server. Set up the DNS to point the (sub)domain to to your IP address, set up mod_rewrite to point each (sub)domain to a subfolder as desired, and that's it. I suspect that they have moved you to a shared IP address, which means that a change to httpd.conf is required to support additional subdomains.
Jim