1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Need help with htaccess

Discussion in 'General PHP and MySQL Discussions' started by Puntocom, Apr 17, 2012.

  1. Puntocom

    Puntocom Well-Known Member

    Hi, I'm setting up a site to sell domain names and I want to redirect domains with this url format:
    Code:
    http://example.com/domain/domainname.com
    to be redirected to:
    Code:
    http://example.com/domain.php?name=$1
    Please can you help me? I have tried several examples and it gives me error. This rule works but I don't want the URLs to be http://example.com/domainname.com.html
    Code:
    RewriteRule ^([^/]+).html$ dominio.php?dominio=$1 [L]
    Any help would be greatly appreciated.
     
  2. Puntocom

    Puntocom Well-Known Member

    I solved it this way:
    Code:
    RewriteRule ^dominio/(.*)$ dominio.php?nombre=$1
    
     
    TheVisitors likes this.

Share This Page