View Single Post
  #3 (permalink)  
Old 03-03-2008, 09:52 AM
wige's Avatar
wige wige is offline
Moderator
WebProWorld Moderator
 

Join Date: Jun 2006
Location: United States
Posts: 1,782
wige RepRank 4wige RepRank 4wige RepRank 4wige RepRank 4
Default Re: htaccess redirect

You have to remove the domain name when doing an internal redirect. For example:

User URL: yoursite.com/products/my-great-product.html
URL of the script: yoursite.com/showproduct.php?name=my-great-product
Redirect Rule: RewriteRule ^/products/(.*).html$ /showproduct.php?name=$1 [L]

Otherwise, if you include the domain name in the redirect rule, the server will assume you want to redirect the user to an external site and will use a 302 redirect.
__________________
The best way to learn anything, is to question everything.
Reply With Quote