Forum Moderators: mack

Message Too Old, No Replies

godaddy screws up subdomains

uggh this irks me

         

misseskisses

10:23 pm on Jul 16, 2007 (gmt 0)

10+ Year Member



how expensive do you have to go before you get hosting that does not SUCK? and once you find good hosting, what guarantees do you have that the company wont start doing all this stupid automated crap that screws with you? im not new to web stuff but i feel like i am new cuz everything is all changing. at least with cheap hosting like godaddy UGGH :0P

i created new subdomains for my website (all the old ones work fine with the 301 redirect i manually set up using the htaccess file - i set them up so if you type "example.com/folder1" it will redirect to "folder1.example.com")

anyway with all the new subdomains i set up...after i modified the htaccess file to include these new subdomains i get error messages when i try to go to the new subdomains. the error says something like

"too many redirects occurred trying to open "folder1.example.com" - this may occur if you open a page that is redirected to open another page which is then redirected to open the original page"

my boyfriend called and tried to figure it out and he was on the phone screaming foul words at them for hours and then he finally found someone who knew what was going on and i think the verdict is "you're screwed". i guess there are automatic redirects that godaddy sticks in but they dont seem to work, and when you do your own the RIGHT way using htaccess stuff it says "you are doing something that has already been done"

anyway...moral to the story i guess is avoid cheap hosting

jdMorgan

11:53 pm on Jul 16, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



If you are internally rewriting the URLs folder1.example.com/ to the file(s) example.com/folder1/, and you are also externally redirecting the URLs example.com/folder1/ to the URLs folder1.example.com/, then that is setting up a loop.

To avoid it, you can use a RewriteCond to see if the request for example.com/folder1 is occurring as a result of a client request, or as a result of the internal rewrite.

It is also necessary to check to be sure that you avoid rewriting example.com/folder1 to example.com/folder1/folder1... ad infinitum.

Here's an example of one way to accomplish this in example.com/.htaccess:


# Externally redirect (only) client requests for example.com/<subdomain> to subdomain.example.com/
# (This will not apply if the request is the result of the following internal rewrite)
RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /(folder1¦folder2¦folder3)
RewriteRule ^[^/]+(.*)$ http://%1.example.com$1 [R=301,L]
#
# Internally rewrite <subdomain>.example.com/<URL-path> to /<subdomain>/<file-path>, but
# only if we haven't already done it, and exclude the "www" subdomain from this rewrite.
RewriteCond %{ENV:RewriteDone} !^Yes$
RewriteCond %{HTTP_HOST} !^www\.
RewriteCond %{HTTP_HOST} ^([^.]+)\.example\.com
RewriteRule (.*) /%1/$1 [E=RewriteDone:Yes,L]

Change the broken pipe "¦" characters to solid pipe characters before attempting to use this example; Posting on this forum modifies the pipe characters.

This also assumes that you have wild-card subdomains enabled in DNS and in conf.d, and that no "control panel" functions have been used to generate any subdomain-related code in the conf.d file that interferes with this code.

Jim

misseskisses

5:53 am on Jul 17, 2007 (gmt 0)

10+ Year Member



hi :0) thanks very very much for your help but i really dont understand too much of what you are saying here :0( soweez

if it's ok here is a screencap of the htaccess file that works EXCEPT for the very last line. in other words, all the stuff listed here works correctly as far as subdomains getting redirected but the very last line that says /aj-cook/ is the only one that does not work. again the only difference between the /aj-cook/ subdomain and the others is that all the others were created more than a year ago and the aj-cook subdomain was created yesterday with a different setup within the hosting preferences.

screencap: <snip>

of course their tech support has no idea :0P

:0)

[edited by: engine at 7:56 am (utc) on July 17, 2007]
[edit reason] No urls, thanks. See TOS [webmasterworld.com] [/edit]