homepage Welcome to WebmasterWorld Guest from
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member
Home / Forums Index / Code, Content, and Presentation / Apache Web Server
Forum Library, Charter, Moderators: Ocean10000 & incrediBILL & phranque

Apache Web Server Forum

url rewrite for dot.tk site redirection
url rewrite for dot.tk site redirection

 9:54 am on Feb 26, 2004 (gmt 0)

Hello All,

I am using dot.tk free site redirection service, let's say :

mydomain.tk is redirected to [free.webspace.com...]

mod_rewrite is activated in my site provider, I have tested successfully. My question is, can I actually use url rewriting to enable trailing in mydomain.tk, for example

[mydomain.tk...] for

I have tried to put the following in the .htaccess, but no succeeded :-(

Options +FollowSymlinks
RewriteEngine on
RewriteCond %{HTTP_HOST} mydomain.tk$ [NC]
RewriteCond %{REQUEST_URI}!^/courbevoie/.*$
RewriteRule ^(.*)$ [free.webspace.com...] [R]

Anyone can help me out pls

Thx & Rgds,



 5:07 pm on Feb 26, 2004 (gmt 0)


Welcome to WebmasterWorld [webmasterworld.com]!

> can I actually use url rewriting to enable trailing in mydomain.tk

I'm sorry, but I don't understand the question -- specifically the phrase "trailing in mydomain.tk". Could you re-phrase that?

However, if you are serious about getting good search engine rankings and perhaps earning money from your site, I would advise you to avoid domain redirection and "free" hosting, and all their attendeant complications, and set up a simple direct hosting account and domain registration/name services.



 8:26 pm on Feb 26, 2004 (gmt 0)

Thanks Jim,

What I mean with enabling trailing in mydomain.tk is that, provided I have a page whatever.php in my real host [free.webspace.com...]

I can go call this page by specifying the url :


unfortunately I can't do that, everytime I do [mydomain.tk...] or [mydomain.tk...]

It always bring me to the home directory of my site i.e. [free.webspace.com...] the url address bar is showing [mydomain.tk,...] I can't put any trailing after [mydomain.tk...]

By the way, thx for your suggestion, actually I am using paid hosting, .tk domain is for temporary domain for my second domain.


 12:16 am on Feb 27, 2004 (gmt 0)


I don't see anything seriously wrong with your code, but here's what I would use:

Options +FollowSymlinks
RewriteEngine on
RewriteCond %{HTTP_HOST} ^(www\.)?mydomain\.tk [NC]
RewriteCond %{REQUEST_URI} !^/courbevoie/
RewriteRule (.*) http://free.webspace.com/courbevoie/$1 [R=301,L]

If that does not work, look for the problem in one of these places:

  • Other rewrite or redirect code before or after the code you posted.
  • Rewrite or redirect code on the free webspace server.


  • courbevoie

     9:09 am on Feb 27, 2004 (gmt 0)


    I tried your htaccess code, doesn't work either, then I tried with other site redirection ie. .co.nr and
    mydomain.co.nr works no problem, I can do trailing after slash. Well finally,
    my conclusion is that the the particularity of .tk redirection not to allow trailing after slash. Thanks a million

    I tried my htaccess code, and it also works.

    Btw, you said this

    > However, if you are serious about getting good search engine rankings and perhaps earning money from your site

    Could you tell me a little bit about this, as I am newbie in this arena, earning money by putting a kind of "ads by google" are you referring to?



     4:07 pm on Feb 27, 2004 (gmt 0)

    What I meant is that free web hosting and domain forwarding often have limitations or side-effects that will cause you serious problems later if your sites are successful. It is often impossible to do a domain redirect from a free webhost, so if your site grows to the point that you need a "real server," you cannot redirect your old domain's existing backlinks to your new domain. So you lose your incoming links unless you can get the webmasters of the sites linking to you to update your URL.

    We get a lot of posts here about this -- people who essentially lose their ODP link because there is no editor in their category and they can't get it updated when they change domains. So in effect, they lose their ODP listing, their Google Directory listing, and their listings in hundeds of ODP clone sites. And they also effectively lose their search listings in the search engines that harvest these directories for links. While this kind of problem may not be important on a hobby site, it can potentially destroy a business.

    So my advice is to always use a real domain registrar and a "serious" hosting company, and not get involved with unnecessary complications like domain parking, domain forwarding, and free or low-cost hosting where there is little or no tech support, users can't use .htaccess or mod_rewrite, etc.

    As soon as a site makes $75 a month, it's time to think about high-quality hosting. And by that I mean a unique IP address, mod_rewrite, PERL, PHP, and MYSQL support, a decent stats package, access to raw server logs, competent 24/7 tech support, redundant backbone connections, emergency power generators, backup servers located in different geographic areas, etc. This kind of hosting can be had for about $25 a month, and it's worth it.

    Furthermore, if you want to grow your business, you need a .com or a .co.cc TLD. The .tv TLDs are great for hobby sites, but if you want to be taken seriously, it's almost a necessity to get a .com -- or at least a .net.

    The above may or may not apply to your business, and reflects only my opinions.



     6:46 pm on Feb 27, 2004 (gmt 0)

    I'm struggling to use the information in this thread. I'm trying to send a 301 but only when a request comes from a particular referer. From what I've read here, I arrived at:-

    RewriteCond %{HTTP_REFERER}!^http://(www\.)?domain\.com [NC]
    RewriteRule (.*) [free.webspace.com...] [R=301,L]

    (I've used the same moved-to URL as earlier in the thread. I won't be redirecting to it).

    I've tried it with and without the Options +FollowSymlinks line because I'm trying everything I can see.

    I only want to 301 all requests from any page on a particular site to a specific URL. I've got it wrong haven't I?

    Cancel that request. By gleaning information in another thread, I've managed to sort it out :)

    Global Options:
     top home search open messages active posts  

    Home / Forums Index / Code, Content, and Presentation / Apache Web Server
    rss feed

    All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
    Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
    WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
    © Webmaster World 1996-2014 all rights reserved