1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

Need help w/ htaccess

Discussion in 'PHP' started by mopacfan, Apr 22, 2008.

  1. #1
    I am converting a site from asp to php. I don't want to lose the indexing in the SE's and I would like to use the htaccess file to create a 301 redirect from "xyz.asp" to "xyz.php". But I have no idea how to do so. Can this even be done?
     
    mopacfan, Apr 22, 2008 IP
  2. Jean-Luc

    Jean-Luc Peon

    Messages:
    601
    Likes Received:
    30
    Best Answers:
    0
    Trophy Points:
    0
    #2
    It can be done. Here is a simple example:
    Options +FollowSymlinks
    RewriteEngine on
    
    RewriteRule ^(.*)\.asp$ http://www.your_domain.com/$1.php [L,R=301]
    Code (markup):
    Jean-Luc
     
    Jean-Luc, Apr 22, 2008 IP
    mopacfan likes this.
  3. mopacfan

    mopacfan Peon

    Messages:
    3,273
    Likes Received:
    164
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Jean-Luc,
    Thank you very much for your help. It is very much appreciated.
    :)
     
    mopacfan, Apr 23, 2008 IP