IDN Forums - Internationalized Domain Names  
Home | idntools | Advertise on idnforums | Premium Membership

Go Back   IDN Forums - Internationalized Domain Names > IDN Development > Search Engine Optimization : SEO

Search Engine Optimization : SEO SEO techniques & discussion for IDN Domains.

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 16th October 2006, 02:41 AM
Olney's Avatar
A.W.O.L
 
Join Date: Sep 2005
Location: Tokyo, Japan
Posts: 2,750
iTrader: (13)
Rep Power: 0
Olney has a little shameless behaviour in the past
Code for redirecting your domain using htaccess & getting rid of www

Hey guys,

This is the code to get your domain to automatically forward from www.x something.com
to just

x - - Something.com

Visually I don't like seeing www in front of my IDNs & I'm sure there is going to be someone out there who feels the same.

Use notepad on Windows or I suggest BBedit or Dreamweaver for a Mac.

Name a file htaccess.txt
Put it in your site root

This is the Code

Code:
Options +FollowSymlinks
RewriteEngine on
rewritecond %{http_host} ^www.xn--yourdomain.com [nc]
rewriterule ^(.*)$ http://xn--yourdomain.com/$1 [r=301,nc]

After you upload it to your server change the file on the server's name to .htaccess

& after that your domains will just be
http:// YOURIDN.com
instead of
http:// www,YourIDN.com

& don't thank me be nice to the little woman tonight instead.
__________________
テスト中: ベリーダンス : Japan SEM : カードローン
LosAngeles.jp (Not an IDN, yeah I do those too)
Reply With Quote
  #2 (permalink)  
Old 16th October 2006, 04:01 AM
Drewbert's Avatar
Administrator
 
Join Date: Feb 2006
Posts: 6,091
iTrader: (20)
Rep Power: 0
Drewbert is a tad dodgyDrewbert is a tad dodgyDrewbert is a tad dodgyDrewbert is a tad dodgyDrewbert is a tad dodgyDrewbert is a tad dodgyDrewbert is a tad dodgy
Re: Code for redirecting your domain using htaccess & getting rid of www

Or if you don't want to edit a crap load of htaccess files, you can stick it in your httpd.com file, outside of the virtualhost sections so that it's the default for all domains...

Options +FollowSymlinks
RewriteEngine on
rewritecond %{http_host} /^www.(xn--.+)$/ [nc]
rewriterule ^(.*)$ http://%1/$1 [r=301,nc]

(I just threw that together without checking the apache manual, so test it first I may have not quite got it right)
__________________
It's all jaded style to me.
Reply With Quote
  #3 (permalink)  
Old 16th October 2006, 04:29 AM
Veteran
 
Join Date: Feb 2006
Posts: 7,495
iTrader: (65)
Rep Power: 2667
blastfromthepast will become famous soon enoughblastfromthepast will become famous soon enoughblastfromthepast will become famous soon enoughblastfromthepast will become famous soon enoughblastfromthepast will become famous soon enoughblastfromthepast will become famous soon enoughblastfromthepast will become famous soon enoughblastfromthepast will become famous soon enoughblastfromthepast will become famous soon enough
Re: Code for redirecting your domain using htaccess & getting rid of www

Here is what I use on a per domain basis. The nice thing is that it sends the requesting host a 404 code, which means page not found, which prevents search engines from indexing the 'www.' site and removes it from their index if it exist. At the same time, the 404 error page is defined as being the same as the top page, so the user still gets to the main page, despite that fact that a 404 error was sent. Plus you can track who is visiting the 'www.' addess easily by checking the logs, which will also show a referrer being sent from the nonexistent 'redirect' directory that caused the 404 error.

This is for your httpd.conf file. (With hundreds of domains being served, it is easier to edit in all commands into that one file, and turn off individual .htaccess files entirely, speeds up the server also.)

Code:
<VirtualHost *:80>
DocumentRoot "/home/domain/html/redirect/" 
#since the directory 'redirect' doesn't really exist it goes to the 404
ServerName www.domain.com
CustomLog logs/domain.txt combined
</VirtualHost>

<VirtualHost *:80>
DocumentRoot "/home/domain/html/"
ServerName domain.com
CustomLog logs/domain.txt combined
</VirtualHost>

<Directory /home/domain/html>
Options Indexes FollowSymLinks ExecCGI Includes
RewriteEngine on
ErrorDocument 404 http://domain.com/
</Directory>

Last edited by blastfromthepast; 16th October 2006 at 09:59 AM..
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT. The time now is 12:00 PM.

Site Sponsors
Your ad here
buy idns
domain name lawyer
buy t-shirt
מחיר הזהב

Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.3.0
Copyright idnforums.com 2005

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54