I want to display my title in the url as well as category & subcategory like this.
http://www.phpshiksha.com/php-tutorials-set-time-zone/22-14
I want that this will call a page name default.php or whatever and I will be able to get the category id 22 and subcategory id 14 on the page.May i know what will be the .htaccess rewtite rule for this.
I will appreciate your help.
This should get you started
RewriteEngine on
RewriteRule ^([0-9A-Za-z\-]+)/([0-9]+)-([0-9]+) main.php?title=$1&cat=$2&subcat=$3
It should result in a $_GET array like the following
array(3) {
["title"]=>
string(27) "php-tutorials-set-time-zone"
["cat"]=>
string(2) "22"
["subcat"]=>
string(2) "14"
}
rule for phpshiksha.com/index.php to phpshiksha.com/home
RewriteRule index.php home