Forum Moderators: phranque

Message Too Old, No Replies

What is wrong?!

         

cplus

12:33 am on Nov 12, 2005 (gmt 0)

10+ Year Member



Hi all,
First let me say i'm just an amateur with this things!
Here's my problem:

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.

jdMorgan

12:53 am on Nov 12, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



cplus,

Welcome to WebmasterWorld!

Have your checked your server error log? If so, what do you see in it?

Jim

cplus

1:07 am on Nov 12, 2005 (gmt 0)

10+ Year Member



Hi, Jim.

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.

jdMorgan

1:20 am on Nov 12, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



It appears that your server defaults are different from your previous host, in addition to not handling subdomains and virtual hosts in the normal way.

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

ahead of your rules.

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

See Apache mod_dir DirectoryIndex [httpd.apache.org] and Apache core Options [httpd.apache.org].

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