Forum Moderators: phranque
http://www.example.com/subfolder/jokes_category.php?cat_id=1
http://www.example.com/subfolder/jokes_category.php?cat_id=anynumericvalue
into something like this
http://www.example.com/subfolder/category/page1.html
http://www.example.com/subfolder/category/page2.html
i am trying this but its not wokring
Options +FollowSymLinks
RewriteEngine on
RewriteRule jokes_category/cat_id/(.*)/ jokes_category.php?cat_id=$1
RewriteRule jokes_category/cat_id/(.*) jokes_category.php?cat_id=$1
Options +FollowSymLinks
RewriteEngine on
RewriteRule http://www.example.com/jokes_category/(.*)/(.*)/$ /sms/jokes_category.php?$1=$2
[edited by: jdMorgan at 6:03 pm (utc) on Feb. 24, 2009]
[edit reason] example.com [/edit]
In any location, the substitution path must contain the full path from DocumentRoot to your script.
In "/subfolder/.htaccess":
Options +FollowSymLinks
RewriteEngine on
#
RewriteRule ^jokes_category/cat_id/([^/]+)/?$ /subfolder/jokes_category.php?cat_id=$1 [L]
Options +FollowSymLinks
RewriteEngine on
#
RewriteRule ^subfolder/jokes_category/cat_id/([^/]+)/?$ /subfolder/jokes_category.php?cat_id=$1 [L]
For best results, each object (page, image, etc.) on your site should be accessible by one and only one URL -- termed "the canonical URL." All other variations of domain name, port number, URL, and query string should be redirected to the canonical URL.
Jim
[edited by: jdMorgan at 6:02 pm (utc) on Feb. 24, 2009]
See this thread in our Forum Library: Changing Dynamic URLs to Static URLs [webmasterworld.com]
Jim