Link to home
Start Free TrialLog in
Avatar of mcsolas
mcsolas

asked on

htaccess - forcing a shorter url

I just want to know how to config the htaccess to do this one function:

say someone comes in typing www.domain.dom 

I want to have them arrive at domain.com

Same true for all links. Anything that comes in with www. it trims it out. I just want to keep my url short for when google indexes me the first time.
ASKER CERTIFIED SOLUTION
Avatar of Yujin Boby
Yujin Boby
Flag of India image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of mcsolas
mcsolas

ASKER

I found this snippet on this page:
http://httpd.apache.org/docs/2.0/misc/rewriteguide.html

RewriteCond %{HTTP_HOST}   !^fully\.qualified\.domain\.name [NC]
RewriteCond %{HTTP_HOST}   !^$
RewriteRule ^/(.*)         http://fully.qualified.domain.name/$1 [L,R]

I think this is just about what I need. Still could use a little advice.
Avatar of mcsolas

ASKER

works perfect its already functioning for me :)

http://www.pacificallsurf.com/

redirects perfectly.

I had 2 of those lines in the joomla code already. I simply put them in the same order and it seems to be working within the other commands joomla is doing on the url.