Redirecting a Webpage

Discussion in 'General' started by kendel, Nov 11, 2010.

  1. kendel

    kendel New Member

    I am trying to redirect a sub domain or just a link... but the option does not want to accept the parth...

    example: http://www.example.com/#pcode-GF3/

    It is refusing to accept the parth "#pcode-GF3/"

    Is there any other way around this?
     
  2. falko

    falko Super Moderator Howtoforge Staff

    I'm not sure if # is allowed - this looks like an anchor to me.
     
  3. BorderAmigos

    BorderAmigos New Member

  4. kendel

    kendel New Member

    Whats the best way to always re-direct "example.com" to "www.example.com" I am not sure I understand the subdomain or alias domain setup....
     
  5. linus3x

    linus3x New Member

    I usually do that from .htaccess. Try something like the following:

    Code:
    # If they try to access us with example.com, reroute them to www.example.com
    RewriteCond %{HTTP_HOST} ^example\.com
    RewriteRule ^(.*)$ http://www.example.com/$1 [R=301,L]
    
    This would go in the .htaccess folder in your base web folder - something like:

    Code:
    /var/www/clients/client1/web1/web/.htaccess
    If you want to force every possible permutation to redirect to www.example.com, take a look at this page:

    http://www.besthostratings.com/articles/force-www-htaccess.html

    That link would redirect example.com, mail.example.com, toasteroven.example.com - anything, really - to www.example.com.
     
  6. kendel

    kendel New Member

    I tried that in the /web folder editing the .htaccess of oneof my website but the first time i got an internal error then i tried again and it failed.. It didnt do it
     
  7. drewb0y

    drewb0y Member

    HTML Redirect

    You can also just do a simple html redirect. Like this

    Code:
    <HEAD>
    <meta HTTP-EQUIV="REFRESH" content="0; url=http://www.wherever.com/">
    </HEAD>
    save it as index.html and you're good.

    I did this on one of my web servers for a company site that went out of business. Their DNS was still pointed to my server and I could not get it changed. After the domain was deleted, the server continued to get hammered with requests. So I just put the site back up, and redirected it elsewhere! Problem solved.
     

Share This Page