Forum Moderators: phranque
for example
www.mysite.com/productdesc.php?item_id=2165
to
www.mysite.com
It doesnt matter to what link the site is clicked on theURL should always display www.mysite.com
I read through another post but wasnt able to apply that on my site.
I am on apache server. Any one got any suggestions?
i want users that go to my links such as
[mysite.com...]
[mysite.com...]
[mysite.com...]
to be redirected to
[mysite.com...]
[mysite.com...]
[mysite.com...]
can i use .htaccess for the above scenario ?
[mysite.com...]
and with mod_rewrite enabled, ONE solution is:
RewriteEngine On
# if the requested file is NOT a file
RewriteCond %{REQUEST_FILENAME} !-f
# and the requested file is NOT a directory
RewriteCond %{REQUEST_FILENAME} !-d
# direct to your parsing script
RewriteRule ^(.*)$ /your_script.php [L]
in your .htaccess file.
In your PHP/perl script, you look for and parse out the end of the query string (in this case "/jim") and use that value to populate the variable "name." The script then functions as it normally does, returning data for name=jim (or Jim!) This allows your friendly URL's to function along side your long query strings.
More on mod_rewrite [webmasterworld.com]