Jump to content

  • Log in with Facebook Log in with Twitter Log In with Google      Sign In   
  • Create Account

Subscribe to HRA Now!

 



Are you a Google Analytics enthusiast?

Share and download Custom Google Analytics Reports, dashboards and advanced segments--for FREE! 

 



 

 www.CustomReportSharing.com 

From the folks who brought you High Rankings!


Sponsored Content

 

 
 

Photo
- - - - -

Web Forwarding Vs 301 Redirect


  • Please log in to reply
35 replies to this topic

#31 Jill

Jill

    High Rankings Advisor

  • Admin
  • 32,318 posts

Posted 22 September 2003 - 07:29 PM

You got it, Brian!

Jill

#32 compar

compar

    Just Purrfect

  • Active Members
  • PipPipPipPipPipPip
  • 669 posts
  • Location:Waterloo Ontario Canada

Posted 22 September 2003 - 09:51 PM

There is another method of forwarding which I haven't seen anybody talk about. If your site is on a unix/linux host all your files will normally be keep in a subdirectory somewhere on the server that is called www.yourdomain.com. To redirect another URL to www.yourdomain.com all the hosting company has to do is set up another subdirectory www.differentdomain.com and symbolically link it to www.yourdomain.com. Then when anybody types www.differnetdomain.com into a browser they will see the content that is in the www.yourdomain.com subdirectory.

The problem with this method as I see it is that the URL in the browser is still www.differentdomain.com. So while the content found belongs to www.yourdomain.com the log files will report traffic to www.differnetdomain.com.

I'd be interested in anybody's comment on this method. Pros or cons?

#33 Ron Carnell

Ron Carnell

    HR 6

  • Moderator
  • 959 posts
  • Location:Michigan USA

Posted 22 September 2003 - 11:47 PM

Uh, Bob? Ol' buddy? I think you're trying to cut your meatloaf with a kitchen drawer again. ;)

What you're suggesting would probably work, at least if you could ever find a directory called www.yourdomain.com (it's probably closer to /home/yourdomain/www), but is needlessly complicated and relies on the operating system. Symlinks also introduce the (slight) potential for permission conflicts and security breaches. What you want to accomplish can just as easily be accomplished using just Apache directives, meaning it will work across the OS board.

Apache calls /home/yourdomain/www the DocumentRoot, and it's defined in a VirtualHost block of your htppd.conf file. It might look like this:

<VirtualHost yourdomain.com:80>
DocumentRoot /home/yourdomain/www
ServerName yourdomain.com
</VirtualHost>

So? Just create a new VirtualHost block for differentdomain.com and point it to exactly the same DocumentRoot. It's not any more complicated than that.

Actually, it can be even simpler.

<VirtualHost yourdomain.com:80>
DocumentRoot /home/yourdomain/www
ServerName yourdomain.com
ServerAlias differentdomain.com
</VirtualHost>

The impact? Judge for yourself. Chances are one of these two techniques is what your server is using to allow access to both domain.com and www.domain.com, so everyone should already have plenty of experience with it.

#34 compar

compar

    Just Purrfect

  • Active Members
  • PipPipPipPipPipPip
  • 669 posts
  • Location:Waterloo Ontario Canada

Posted 23 September 2003 - 03:08 PM

Chances are one of these two techniques is what your server is using to allow access to both domain.com and www.domain.com, so everyone should already have plenty of experience with it.

In fact it's not. My guys are using the symlink method to alias mydomain.com to www.mydomain.com. That is specifically why I asked the question. I will have them read your learned reply, because the cost of this method is that you do lose some traffic reporting.

<late addition> For what it is worth Ron the path to all web sites on our FreeBSD server is /usr/local/www/data/www.yourdomain.com. We also put the non-www subdirectory/file here also. So for instance in the case of our own company domain we have /usr/local/www/data/www.compar.com and this is where all the files are actually kept. And we have /usr/local/www/data/compar.com which is symlinked to the "www." folder.

Edited by compar, 23 September 2003 - 03:19 PM.


#35 Ron Carnell

Ron Carnell

    HR 6

  • Moderator
  • 959 posts
  • Location:Michigan USA

Posted 23 September 2003 - 03:26 PM

Traffic reporting as in site logs?

If so, that's a separate issue (though not necessarily unrelated). Your log files are also defined within httpd.conf, though they may or may not be within the VirtualHost blocks. Lots and lots of possible variations here. If your symlinked domain is not already writing to the same log file as your main domain, thereby causing your loss of traffic reporting capability, chances are my first example above wouldn't change anything for you.

The second example, however, using the ServerAlias directive, will. :aloha:

#36 compar

compar

    Just Purrfect

  • Active Members
  • PipPipPipPipPipPip
  • 669 posts
  • Location:Waterloo Ontario Canada

Posted 23 September 2003 - 08:54 PM

Yes as in site logs.

And once again what you say make sense. I'll discuss it with the guys in the morning. The symlinks have never failed us and maybe all we have to do is make sure they report into the same log file as the www. version of the domain.

Damn it I hate it when you are always so smart. :huh:




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users