+ Reply to Thread
Results 1 to 6 of 6

Thread: Redirect Directory to a subdomain with case-insesitivity

  1. #1
    ranjeetm's Avatar
    ranjeetm is offline x10Hosting Member ranjeetm is an unknown quantity at this point
    Join Date
    May 2009
    Posts
    13

    Exclamation Redirect Directory to a subdomain with case-insesitivity

    Hello Friends I have tried hard before posting but was not able to find a solution to my problem...If someone can help me I will be very great full ....


    I want to redirect
    Code:
    http://www.domain.com/mail to http://mail.domain.com
    (A CNAME entry) with case-insensitivity (also with or without WWW)

    i.e
    I also want
    Code:
    http://www.domain.com/Mail or mAil to redirect to http://mail.domain.com
    that also with or without WWW

    for e.g.
    Code:
    http://www.domain.com/mail --> http://mail.domain.com
    Code:
    http://www.domain.com/Mail --> http://mail.domain.com
    Code:
    http://www.domain.com/mAil --> http://mail.domain.com
    Code:
    http://domain.com/mail --> http://mail.domain.com
    Code:
    http://domain.com/Mail -->http://mail.domain.com
    Code:
    http://domain.com/mAil --> http://mail.domain.com
    where
    Code:
    http://mail.domain.com
    is a CNAME record I haven't added a directory of this name in my root directory...

    Thanks in Advance.....
    Last edited by ranjeetm; 11-07-2010 at 02:25 AM.

  2. #2
    Twinkie is offline Banned Twinkie is an unknown quantity at this point
    Join Date
    Sep 2007
    Location
    Ft. Lauderdale, Florida
    Posts
    1,389

    Re: Redirect Directory to a subdomain with case-insesitivity

    I am pretty sure that a CNAME record is not the best way to go. I would use .htaccess to redirect people who access any variation of /mail to mail., and there should be a CNAME record that covers a user appending a www. to the domain by removing it.

    Exmaple: www.exmaple.com/mail

    CNAME Record (step 1):
    www.example.com/mail -> example.com/mail

    .HTACCESS (step 2)
    example.com/mail -> mail.example.com
    http://www.webweaver.nu/html-tips/web-redirection.shtml

    I would rather you read the article for yourself and learn something
    Last edited by Twinkie; 11-07-2010 at 09:33 AM.

  3. #3
    bdistler's Avatar
    bdistler is offline x10 Lieutenant bdistler is an unknown quantity at this point
    Join Date
    May 2010
    Location
    Catalina AZ USA
    Posts
    349

    Re: Redirect Directory to a subdomain with case-insesitivity

    htaccess Redirect and Rewrite will NOT work on server "boru"

  4. #4
    lemon-tree's Avatar
    lemon-tree is offline x10 Minion lemon-tree has a spectacular aura about
    Join Date
    Nov 2007
    Posts
    1,420

    Re: Redirect Directory to a subdomain with case-insesitivity

    .htaccess should be functioning on all of the servers and if they are not then there is something odd going on. Anyway, here is an example .htaccess you could use:
    Code:
    RewriteEngine on
    RewriteRule ^mail(/.*)?$ "http://mail.yourdomain.com$1" [R=301,L,NC]
    This code will take into account all case-derivatives of 'mail', so 'Mail' and 'MAil' etc will all be redirected to http://mail.yourdomain.com . This will also redirect subdirectories of the mail folder to subdirectories in the mail subdomain, so sending a request for http://yourdomain.com/mail/folder1/folder2/file.php will redirect to http://mail.yourdomian.com/folder1/folder2/file.php .
    I think this covers everything that you required in your request, to use this simply create a file called '.htaccess' in the root of the domain you are redirecting FROM (So put it in the folder where you put files for http://yourdomain.com) and put that code in that file.

  5. #5
    ranjeetm's Avatar
    ranjeetm is offline x10Hosting Member ranjeetm is an unknown quantity at this point
    Join Date
    May 2009
    Posts
    13

    Re: Redirect Directory to a subdomain with case-insesitivity

    Thanks will implement ... will let you know if it works or not.....

  6. #6
    bdistler's Avatar
    bdistler is offline x10 Lieutenant bdistler is an unknown quantity at this point
    Join Date
    May 2010
    Location
    Catalina AZ USA
    Posts
    349

    Re: Redirect Directory to a subdomain with case-insesitivity

    As for htaccess Redirect and Rewrite
    check these threads...

    .htaccess on server boru

    Website redirects to 500 Internal Server Error

+ Reply to Thread

Similar Threads

  1. Redirect Root Directory to Subdirectory w/ Joomla
    By caiol611 in forum Tutorials
    Replies: 8
    Last Post: 02-17-2011, 04:31 PM
  2. subdomain redirect
    By Tenant in forum Programming Help
    Replies: 1
    Last Post: 07-12-2010, 07:15 PM
  3. Case insensitive redirect
    By lydia09 in forum Programming Help
    Replies: 2
    Last Post: 01-31-2010, 08:58 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
x10hosting free hosting for the masses
dedicated servers