View Full Version : htaccess question
GeorgeTH
2003-10-29, 05:47 PM
How can I set my .htaccess (I assume that's where it's done...) so that any call for my site always goes to the same url?
To confusing the way I expressed this? - o.k. - let me explain:
I want all hits to go to www.mysite.com/index.shtml
type-in traffic to http://mysite.com without www.
traffic to http://mysite.com/index.shtml - again without www.
(I have already a line
DirectoryIndex index.shtml index.php index.html index.htm which defines the load order...)
Reason: unified referrer url in stats - currently I'm sending traffic out from all different options like http://www.mysite.com/index.shtml, http://mysite.com, http://mysite.com/, http://mysite.com/index.shtml - which in several counters shows as 3 or 4 different referrers and much less traffic in either option than the combined traffic.
Cheers
dareutwo
2003-10-29, 07:29 PM
Evening George -
Look at the top of your browser.
See that button that says "Search"?
Click that and type in "htaccess"
Should find your answer there.
Otherwise Cleo has a fine page from her webmasters page.
Not being synical.. just can't remember the actual URL's of this... it has been covered here before though. :)
DangerDave
2003-10-29, 08:03 PM
Still too easy :D
RewriteCond %{HTTP_HOST} !^www\.yourdomain\.com
RewriteRule ^(.*)$ http://www.yourdomain.com/$1 [R=permanent,L]
DD
GeorgeTH
2003-10-29, 08:55 PM
Originally posted by DangerDave
Still too easy :D
Many thanks - still the best board around |peace|
Be careful using this on a domain with stuff submitted. If you submit your stuff without the www then it will trigger bots to show a redirect.
DangerDave
2003-10-29, 09:32 PM
Very true Cleo....
as with most htacc redirection thingies... these are not to be applied without planning and forethought..
DD
GeorgeTH
2003-10-29, 09:58 PM
Thanks for the warning!
I wanted to use it for my TGP sites, because only ~50% of the hits arrive at http://www.picxs.com/index.shtml, the remaining 50% are split across 3 other options... Now if somebody submits and uses a counter like Sextracker it might show that I'm sending 600 hits that day, where in fact it could be well over 1,000 once they check further down the list...
Question:
does this help with Google listings, too?
Currently you might find http://picxs.com/ right above http://www.picxs.com/index.shtml in their results - I would think a combined listing might actually boost my position (rather than hurt it).
Hmmm, I wonder if it will hurt you since the SEs might see it as redirecting.
DangerDave
2003-10-30, 12:27 AM
does this help with Google listings, too? Don't know if "help" is the right word.. but yes it can effect your Google listings..
Rule #1 - always use http://www.domain.com/ when linking, when exchanging links etc, and then ALWAYS use it into the future.
Rule#2 - if you use http://domain.com/ then keep using that syntax.. dont mix them up.
The permanent redirect "should" help refine your pages and SE listings, as google will find http://www.domain.com/ each time.
IF it is done as a permanent redirect, it will not be classed as "redirecting" by the SE's and robots.
DD
vBulletin® v3.8.1, Copyright ©2000-2026, Jelsoft Enterprises Ltd.