It has been tight week

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% [?]




Related Post:
  • Hectic Week
  • Salary is $1 million a week
  • Long Long Week
  • Was away for a while and will still be away until the 15th.
  • Visit Singapore
  • Google slip on search share
  • Mafia Wars Facebook
  • Cuti Cuti Malaysia to Perhentian Island




  • 8 Responses to 'It has been tight week'

    1. Azmeen - September 21st, 2007 at 4:40 pm

      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.

    2. Azmeen - September 21st, 2007 at 4:42 pm

      Your comment script ate my plus sign!!!

      ^siteid=([0-9] )$ should be ^siteid=([0-9] )$

    3. Azmeen - September 21st, 2007 at 4:44 pm

      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 :)

    4. 8dee - September 21st, 2007 at 5:44 pm

      Thanks, I will give it a try immediately

    5. 8dee - September 21st, 2007 at 5:52 pm

      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

    6. 8dee - September 21st, 2007 at 6:04 pm

      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

    7. Azmeen - September 21st, 2007 at 7:38 pm

      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?

    8. 8dee - September 21st, 2007 at 10:23 pm

      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!


    Leave a Reply