I need help with htaccess

Discussion in 'PHP' started by z0haib, Jul 20, 2008.

  1. #1
    Hi, i need help with htaccess.. I want to redirect visitors from old url to new url.

    old url is like:
    http://www.yoursite.com/site/anything-blog-title/

    i want to redirect it to:
    http://www.yoursite.com/anything-blog-title/

    Please help me out..
    Thanks in advance..
     
    z0haib, Jul 20, 2008 IP
  2. rohan_shenoy

    rohan_shenoy Active Member

    Messages:
    441
    Likes Received:
    20
    Best Answers:
    0
    Trophy Points:
    60
    #2
    More info please.
    Are you using wordpress or any hand-coded website or any other CMS?
     
    rohan_shenoy, Jul 20, 2008 IP
  3. mywedding

    mywedding Peon

    Messages:
    14
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    just write in htaccsess "redirect newdomainadress olddomainadress"

    without"
     
    mywedding, Jul 20, 2008 IP
  4. BMR777

    BMR777 Well-Known Member

    Messages:
    145
    Likes Received:
    8
    Best Answers:
    1
    Trophy Points:
    140
    #4
    Try This:

    Options +FollowSymLinks
    Options +Indexes
    RewriteEngine On
    
    RewriteRule ^site/(.+)$ /$1 [QSA,L]
    
    
    Code (markup):
    Mod-Rewrite must be enabled. Also, this should be on the same domain, not two seperate sites. Change "site" to where the blog is installed, if necessary. Place this in the .htaccess in the root / public_html of your site. Please +rep if this works. :)

    BMR777
     
    BMR777, Jul 20, 2008 IP
  5. projectWORD

    projectWORD Active Member

    Messages:
    287
    Likes Received:
    2
    Best Answers:
    1
    Trophy Points:
    63
    #5
    projectWORD, Jul 20, 2008 IP
  6. z0haib

    z0haib Peon

    Messages:
    4
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #6
    Thanks, BMR777

    Yes it is working just like i wanted to be.

    Thanks again..

    Zohaib


     
    z0haib, Jul 22, 2008 IP