Connecting Tech Pros Worldwide Forums | Help | Site Map

htaccess

Familiar Sight
 
Join Date: Oct 2008
Posts: 143
#1: Jan 12 '09
there is a way to change the name of a file ,and the file will act the same?

insead of product.php?id=123

to
sale.php?id=123

thanx

Atli's Avatar
Moderator
 
Join Date: Nov 2006
Location: Iceland
Posts: 3,751
#2: Jan 16 '09

re: htaccess


Sure, you can do that using mod_rewrite.

Soemething like this should do it:
Expand|Select|Wrap|Line Numbers
  1. RewriteEngine on
  2. RewriteRule ^sales.php$ product.php?%{QUERY_STRING}
See the documentation for details on how to customize that.
Reply