Forum Moderators: phranque
I want to display a users blog when he types "blogs.mysite.com/username". For that i created a subdomain called "blogs", forwarding to "http://www.mysite.com/blogs.php?u=/". In a subfolder called "blogs", i had a ".htaccess" file like this:
RewriteEngine on
RewriteCond %{HTTP_HOST} ^blogs.mysite.com$ [OR]
RewriteCond %{HTTP_HOST} ^www.blogs.mysite.com$
RewriteRule ^(.*)$ [mysite.com...] [R=301,L]
Last, my file "/blogs.php" would take $_GET['u'] and check it against a valid username in the database, and do whatever with it.
This was working fine, but now i just changed hosting company of my website, replicated the all thing, and it wont work! Could i be doing something wrong that my previous hoster would understand and this one doesn't?!
Thanks.
When i type "blogs.mysite.com", error is:
Directory index forbidden by rule: /usr/local/4admin/apache/vhosts/mysite.com/httpdocs/blogs/
When i type "blogs.mysite.com/username", error is: none! Error 404 on page.
I just got an answer from my hosting company, and still don't know what to do:
«I believe the issue lies with how our forwarding script works for our subdomain manager. There is a file created when you make subdomains called ".redirect.php". This file "secretly" controls your how your traffic is handled. I have created a copy for you called "redirect.php" so you can see it. This script is more than likely the culprit with your forwarding. Your old host probably used actual VHOST conf entries for your subdomains, but here we do not.
To work around this I recommend that you disable ALL your subdomains and add them via the "add-on domains" manager. This method does not use a redirect script and should handle your requests better.
We are working to remove this type of forwarding all together so we can use conf entries instead (like every other hosting company).
If you add these subdomains in your add-on domains manager and they still do not work, we will not be able to help you.»
Isn't that great?!
Regards.
If you want to see if you can get your 'main pages' working, so that you can communicate the current situation to your visitors, then try adding:
Options +Indexes +FollowSymLinks
Alternately, if you wish to define a page to be served instead of an index (directory content listing) when requesting "example.com/", then you'll need to define it:
DirectoryIndex name_of_page.extension
Options +FollowSymLinks
The take-home lesson here is, if possible, to test your site on a new host before changing hosts, and keep the old account paid-up so that you can switch back at the first sign of trouble if problems are encountered on the live site on the new server that were not detected during testing.
Jim