short url for SERVER

Discussion in 'Installation/Configuration' started by pawan, Aug 9, 2010.

  1. pawan

    pawan Member HowtoForge Supporter

    short URL

    I have tried it both ways.

    that is without creating any sub-domain and any DNS for admin

    When I create the sub-domain admin for and adding admin in dns A records for
    I am getting the home page of instead of being redirected to

    Please tell me what I am missing.
  2. pawan

    pawan Member HowtoForge Supporter

    short URL

    Some Times not getting the full answer or hand-holding does help.

    I was successful after digging in and trying various options.

    I am putting it here, if it can help somebody out there.

    to achieve redirect to

    I tried various options like:
    Just putting the code provide earlier by Till in apache directive under option tab for website

    RewriteCond %{HTTP_HOST}   ^ [NC]
    RewriteRule ^/(.*) [L,R]
    which was giving me error - page not found.

    Then I created subdomain admin in website options and also added A record for admin in DNS record for

    The result : I start getting the home page of - no redirect.

    Finally I deleted the sub-domain created in website options, deleted the DNS entry admin in I also deleted the code inserted in apache directive.

    Than I created one new domain under :// domain option and created DNS records for

    I also created website for and in redirect option I inserted the full path like and in redirect type I selected [R,L] and

    Presto - my-redirection was working perfectly.

    I also checked the vhost file, where the code was automatically inserted in /etc/apache2/sited-enabled/ file similar to given by till

     RewriteEngine on
        RewriteCond %{HTTP_HOST}   ^ [NC]
        RewriteRule   ^/(.*)$$1  [R,L]
    Yes there was one more problem I was facing that I was not able to access or even from other PC than server.
    Than I have added server1 to DNS record of, which enable me to access the from anywhere.

    Hope this will help someone in same situation.


Share This Page