Forum Moderators: phranque
First link:
http://www.example.com/category_programs.php?categoryID=4&category=Administrative
I want it to look like this :
http://www.example.com/Administrative
if it's like this
http://www.example.com/category_programs.php?categoryID=9&category=Business&records=2
I want
http://www.example.com/Administrative/2
I don't care if someone types in the latter and it doesn't work; that's not my concern.
I used this for a test
Options +FollowSymLinks -MultiViews
rewriteEngine on
rewriteRule ^foo\.html$ [google.com...] [R=301,L]
Most of the traditional stuff that some helper tools produced would not work. http://www.example.com/pi.php
[edited by: jdMorgan at 7:19 pm (utc) on July 10, 2007]
[edit reason] Example.com & no buying/selling, please. [/edit]
http://www.example.com/category_programs.php?categoryID=4&category=AdministrativeI want it to look like this :
http://www.example.com/Administrative
First step: Change the link on your page to the second form. What is on your page determines what the URL actually is, and what it "looks like."
Second step: Add an internal rewrite (mod_rewrite) to change the default URL-to-filename translation for that URL, so that it resolves to the original filepath (script filename plus the required query string parameters).
Note that mod_rewrite cannot 'create' information, so we assume that "Adminstrative" implies all of "/category_programs.php?categoryID=4&category=Administrative" -- nothing more, nothing less.
Third step (optional): Add an external redirect using mod_rewrite to redirect the old dynamic URL to the new static one if and only if the request is a direct client request for the dynamic URL, and not occurring as a result of the previously-discussed internal rewrite (Use RewriteCond checking server variable THE_REQUEST to accomplish this). This will 'fix up' your search engine listings over time.
More info: [webmasterworld.com...]
Jim