Mobile app version of vmapp.org
Login or Join
XinRu657

: Redirecting domain to subfolder, one hosting account, avoid redirect loop. masking? I have two domains (here are the actual domain names for simplicity): snapstarr.com fuselog.net I have one hosting

@XinRu657

Posted in: #Masking #ModRewrite #MultipleDomains #Redirects #Subdomain

I have two domains (here are the actual domain names for simplicity):

snapstarr.com
fuselog.net


I have one hosting account with GoDaddy, for the two domains. the primary domain is snapstarr.com. I have some subfolders on snapstarr.com:

snapstarr.com/lockbox
snapstarr.com/fuselog
snapstarr.com/nomouse


at this point, you might notice that the 2nd subdirectory in that list is the same as the secondary domain listed at the top.

By default, when purchasing an add-on domain with GoDaddy, no additional redirecting needs to be set up (possibly common knowledge). so whan a visitor navigates to fuselog.net, they see the website comprised of the files that are sitting in snapstarr.com/fuselog, but fuselog.net remains in the address bar (with whatever slashes and autofills the browser appends to it).

that's all well and good and perfect, until a user navigates to fuselog.net, fuselog.net/, fuselog.net, fuselog.net/, snapstarr.com/fuselog, www.snapstarr.com/fuselog/ etc. etc. and every other combination of trailing slashes and leading w's.

What I need is for every single one of the possible formats to bring the user to the same location, and also consistently show that in the browser's URL bar.

I have multiple reasons to want to do this. one, i simply don't want a visitor to see snapstarr.com/fuselog in their browser bar. the sites are unrelated, and if someone ever navigates there, I want to change the URL to fuselog.net, because that's the name of the site they're looking at.

There is also the issue of cookies. fuselog.net and fuselog.net are not the same place, to search engines or to browsers. I don't want to save my cookies with the ".fuselog.net" trick, I'd rather just store everything as fuselog.net, which I've read has a slight speed advantage also.

So in summary, I would like the following formats (and only these):

snapstarr.com/fuselog
snapstarr.com/fuselog/ snapstarr.com/fuselog www.snapstarr.com/fuselog/ www.snapstarr.com/fuselog http://www.snapstarr.com/fuselog/
fuselog.net
fuselog.net/ fuselog.net www.fuselog.net/ www.fuselog.net http://www.fuselog.net/


to show the website in the folder:

snapstarr.com/fuselog


but always display:
www.fuselog.net/

in the browser bar.

If it's relevant: I need normal function of snapstarr.com to be preserved. that is, the root of snapstarr.com is its own site. Ideally, I'd like to see www's no matter what a user types or which domain they are trying to get to.

I have talked to many different people at GoDaddy, sometimes their "domain specialists", and we've gotten very close. in each attempt (two weeks worth). I'm able to get most, but not all of the conditions to be met. I've searched for and tried lots of mod_rewrite approaches and made a slew of custom .htaccess files.

I've ended up with inevitable redirect loops because I tried putting one in the root and one in the subdirectory.

I simply don't know enough about regular expression and mod_rewrite rules, and my head doesn't seem malleable enough to wrap it around this stuff.

I'll spare you the many RewriteCond's and RewriteRule's that I've tried, as I'm sure anyone capable of answering this question has seen them all. At this point I'm just hoping someone knows the order in which I need to place the rules and what their contents need to be. I appreciate any and all input, immensely.

10.01% popularity Vote Up Vote Down


Login to follow query

More posts by @XinRu657

1 Comments

Sorted by latest first Latest Oldest Best

 

@Heady270

Step 1: Set up your add-on domain with separate FTP

Here is GoDaddy documentation for an add-on domain. Their instructions says that creating a secondary domain with different content will create a separate ftp user and password where you can upload your content. That is what you want to do. If you do it that way then snapstarr.com/fuselog/ (and related variants) won't show the same content.

Step 2: Redirect fuselog.net to fuselog.net
from How to forward non-www to Using Godaddy DNS Manager, Wooble says: "Fortunately, Godaddy provides this service for free; follow these directions

Step 3: Redirect snapstarr.com/fuselog/ to fuselog.net
Here are the instructions for setting up a redirect on your snapstarr domain



The only other thing that you appear to be confused about is that several of your examples are the same thing. There is no difference between:
fuselog.net www.fuselog.net/ www.fuselog.net http://www.fuselog.net/


In those cases, the browser may or may not choose to show the leading . If the browser doesn't show it, it is still there, just implicit. Newer versions of Firefox never show it, for example. But if you copy the URL from the address bar the gets added.

Similarly, for a domain name root directory, the trailing slash is assumed. Browsers have no way of making the request without it. According to the HTTP spec, every request must start with a /. Whether or not it is shown in the URL bar is completely cosmetic. (Trailing slashes after deeper directories are a different story, however.)

10% popularity Vote Up Vote Down


Back to top | Use Dark Theme