Forum Moderators: phranque
I want to make widgets.com/nimc/gallery/categories.php?cat_id=1 search engine friendly so I tried
like
widgets.com/nimc/gallery/categories1.php
So I tried
RewriteEngine on
RewriteBase /
RewriteRule ^categoriesid([^.]+).* /categories.php?cat_id=$1
[T=application/x-httpd-php]
and some combinations
but it didnt work, I know this must have been discussed over and over, I just need a simple answer to start off, can someone please tell me how can I do that. Please help me , your suggestion will be highly appreciated.
Thanks
AjiNIMC
What did your server error log say?Jim
Jim, I havent checked the server error log at that time, next time I do it I will check the errors too.
You also have ot make the appropriate alterations to your script or CMS to make it generate and use the new URL structure: the mod_rewrite rules alone won't make that change. All that mod_rewrite does is transparently rewrite the request into something the CMS will understand.encyclo
encyclo, I think I am missing this section of work. What kind of alteration is requirement? At what level should I use it? Do I need to run .htaccess files to see the changes?
Thanks Jim and encyclo for help , looking forward to learn more on this issue.
Regards
AjiNIMC
<? echo "<a href=\"http://widgets.com/nimc/gallery/categories1.php\">Click to see cat #1</a>"; ?>
Then your visitors will click on that link (or a spider will find it).
This results in a request to your server for "http://widgets.com/nimc/gallery/categories1.php"
mod_rewrite receives that request when it arrives at your server, and changes it into an internal request for "/nimc/gallery/categories.php?cat_id=1"
This runs your script again with the correct "cat=1" parameter.
Jim