Jump to content

Website redirection help

- - - - -

  • Please log in to reply
4 replies to this topic

#1
ahmed

ahmed

    Programming Professional

  • Members
  • PipPipPipPipPip
  • 304 posts
I want to know that how can i redirect website if someone types mywebsite.com to this www.mywebsite.com ? Is there something to be done with the .htacess file?

#2
CommittedC0der

CommittedC0der

    Speaks fluent binary

  • Members
  • PipPipPipPipPipPipPipPip
  • 1,565 posts
I don't now about .httacess, but I know a lil' PHP will do the trick.
<?php    
header( 'Location: http://www.yourwebsite.com/' ) ; 
?>

Good luck ~ Committed. :)
A man can be defined by what he does when no one is looking.
Science is only an educated theory, which we cannot disprove.

#3
isuru

isuru

    Programming Professional

  • Members
  • PipPipPipPipPip
  • 233 posts
Consult this -> Redirecting web pages in cPanel
And here is the free .htacess redirect file generator Free .htaccess Redirect Generator
Lost!

#4
Paul0130

Paul0130

    Newbie

  • Members
  • Pip
  • 7 posts
I am unsure on the code but it can 100% be done with htaccess!

#5
Alexander

Alexander

    It's Science!

  • Moderators
  • 4,124 posts
  • Location:Vancouver, Eh! Cleverness: 200
It may be preferred to redirect the user without provoking PHP to handle it (if that is possible in that installation). The htaccess method, using permanent 3xx redirect will be sufficient.

An issue with the file will likely cause the web page to be blank, or display a 500 error, you can remove the file and ask here if that is the case.

Alexander.
Be sure to read the updated FAQ! || Health is achieved through the same 10,000 steps.
If a suggested code/method fails, informing us is less important than telling us why or what errors occurred.




1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users