After few trial and few days of installation for my Malaysia Property classifieds, I am so tired now. But things are not settle yet as I am unable to redirect the old post to the new post. I tried various codes with htaccess to redirect
http://www.syiok.com/detail.php?siteid=xxxx to http://www.syiok.com/classifieds/detail.php?id=xxxx
If you have any idea, let me know, it would be helpful. I have tried this almost the whole day yesterday.
Anyway, it have a new templates now, and much better looking. I am glad that I make a few trial run in a subfolder before actually upgrading the script. It is much harder compare to wordpress upgrade.
Popularity: 1% [?]



Need some mod_rewrite voodoo, eh? Try this:
RewriteEngine on
RewriteBase /
RewriteCond %{REQUEST_URI} ^/detail.php$
RewriteCond %{QUERY_STRING} ^siteid=([0-9] )$
RewriteRule . /classifieds/detail.php?id=%1 [R=301,L]
I assume your id and siteid are integers. Adjust accordingly if it’s wrong.
Your comment script ate my plus sign!!!
^siteid=([0-9] )$ should be ^siteid=([0-9] )$
I give up, just put the plus sign after 9] and before )$
You really ought to fix this AJAX comment, or perhaps not use it at all
Thanks, I will give it a try immediately
Ajax is disabled, this is the first time I have encounter this problem, I thought it is better to have it because the page does not need to be reloaded each time someone commented
It doesn’t work
RewriteCond %{REQUEST_URI} ^/detail.php$
do I need to add something behind as there is ?siteid=xxxx
man..i am reading this htaccess for the whole day yesterday and also half of today…I still don’t understand
REQUEST_URI is the particular file being requested and it’s handled here:
RewriteCond %{REQUEST_URI} ^/detail.php$This condition states that if the requested file is http://yourhost/detail.php, then…
The ?siteid=blabla portion is called a query string and is handled by this line:
RewriteCond %{QUERY_STRING} ^siteid=([0-9]+)$The condition that’s applied here is: If a querystring called siteid who’s value consists of only numbers is called, then…
This line glues it all together:
RewriteRule . /classifieds/detail.php?id=%1 [R=301,L]The %1 portion is the regex match that is called earlier from the siteid condition, ie the ([0-9]+) bit. So basically, it says transfer all requests for http://yourhost/detail.php?siteid=123 to http://yourhost/classified/detail.php?id=123
Have you checked your server logs, any errors?
Azmeen: Hey, It works, it is weird, I tried to refresh after I have installed the code, but it did not work at that time. Now it does. I think because of cache. Thanks a lot!