Need some help with .htaccess

Discussion in 'HTML & Website Design' started by max196, Aug 12, 2009.

  1. #1
    Hi friends,

    I want to write this http:/mysitename/details.php?requested=name url to,
    http:/mysitename/text-name-text2/

    I used RewriteRule text-(.*)-text2/ details.php?requested=$1 but didn't worked.

    Previously I used RewriteRule text/(.*)/text2/ details.php?requested=$1 to write the url to http:/mysitename/text/name/text2/. Since I'm new to .htaccess I don't know how to use rewrite rule for using "-" in url.

    Please help me to fix the above issue! Thank You in advance :)
     
    max196, Aug 12, 2009 IP
  2. Big0ne

    Big0ne Well-Known Member

    Messages:
    2,615
    Likes Received:
    81
    Best Answers:
    0
    Trophy Points:
    165
    #2
    # Enable Rewrite Engine
    RewriteEngine on
    
    #Redirect http://mysitename/details.php?requested=name to http://mysitename/text-name-text2/
    Redirect 301 /http://mysitename/details.php?requested=name http://mysitename/text-name-text2/
    
    PHP:
     
    Big0ne, Aug 12, 2009 IP
  3. max196

    max196 Peon

    Messages:
    36
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Hi BigOne,

    Thanks for the reply, but i am asking for URL Rewrite and not the redirect.
     
    max196, Aug 13, 2009 IP
  4. amuthavalli

    amuthavalli Peon

    Messages:
    110
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #4
    see here
    webforgers.net/mod-rewrite/mod-rewrite-syntax.php

    and exactly see here
    webforgers.net/mod-rewrite/basic-tutorials-lesson-1.php
     
    amuthavalli, Aug 14, 2009 IP