URL Re-write

Discussion in 'PHP / Perl / Ruby on Rails' started by DesignWizard, Jan 16, 2009.

  1. DesignWizard CSNM Customer

    Having major problems getting a URL re-write to work correctly.

    It should be something like this:

    www.domain.com/1234/Name > www.domain.com/page.php?id=1234

    Rewrite rule:
    PHP:
    RewriteRule ^([0-9]+)/(.*)$ page.php?id=$
    It brings the page/data up OK - but not the stylesheet info, so it's not displaying correctly. Also, all links on the page now have /1234/ in front of them (e.g. /1234/link.php - Should be link.php)

    Anyone got any ideas?

    Thanks!
  2. Andrew Taylor CS New Media Staff

    Why not put links and stylesheet either to the full domain path, or to root "/link.php"?
  3. DesignWizard CSNM Customer

    Andrew - Thanks that worked a treat! Obvious I suppose!!!

Share This Page