Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    Regular Coder
    Join Date
    Mar 2006
    Posts
    459
    Thanks
    3
    Thanked 0 Times in 0 Posts

    .htaccess Redirect

    Hi all... I know how to do a redirect to a new URL usinga .htaccess file if I am pointing to a different server, however both domain.com and domain.com.cn are pointing to the same server, I just am wondering what I would add into my .htaccess file to get it to redirect from domain.com.cn to domain.com?

  • #2
    Regular Coder BabyJack's Avatar
    Join Date
    Apr 2008
    Location
    Somewhere.
    Posts
    602
    Thanks
    43
    Thanked 6 Times in 6 Posts
    There's a way to get around it without .htaccess... it just needs to go in the <head> part of your HTML document...
    Here is the code:
    <meta http-equiv="refresh" content="5;url="domain.com">

    It's alot quicker and easier to access and modify. Just plop this on domain.com.cn index.html file (or php etc..)
    Enlightenment in Coding
    Validate before Posting | Google is your friend for PC Problems | Make sure you have a doctype

  • #3
    The Apostate Apostropartheid's Avatar
    Join Date
    Oct 2007
    Posts
    3,215
    Thanks
    16
    Thanked 265 Times in 263 Posts
    Or, even better, do it with PHP
    PHP Code:
    <?php
      header
    ('Location: http://example.com/');
    ?>


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •