Jump to content


CSS/Links/Javascript Not Displaying


2 replies to this topic

#1 .CJ

    Young Padawan

  • Members
  • Pip
  • 114 posts
  • Gender:Male
  • Location:Leeds, UK

Posted 04 September 2007 - 03:02 PM

Aye up...

So throughout my site I'm using MOD_REWRITE to change the links, for SEO purposes. So far so good, but come to my first hurdle.

RewriteRule ^ucpanel/([^-]*)-([^-]*)/$ /area52/ucpanel.php?page=$1&mode=$2 [L]

This creates area52/ucpanel/pm-view/

It works... but all the links, CSS and Javascript files that are included are not set right, I'd have to add ../../ to the beginning of each HREF, and I'd rather not if possible.

Perhaps theirs something wrong with my RewriteRule, or maybe I have the .HTACCESS in the wrong place? Currently it's in the ROOT folder.

Any help is appreciated, thanks,

- Chris.

#2 rc69

    PHP Master PD

  • P2L Staff
  • PipPipPipPip
  • 3,827 posts
  • Gender:Male
  • Location:Here
  • Interests:Web Development

Posted 05 September 2007 - 11:44 PM

Look up the <base> html tag. I had to use it when i "rewrote" my links because the browser still sees the address in the url and uses it rather than the redirected address.

i.e.
<base href="http://domain.com/index.php">
Note: It's kinda bi-polar about going into directories, so i've always just used relative links from the root of the site...

Edited by rc69, 05 September 2007 - 11:45 PM.


#3 .CJ

    Young Padawan

  • Members
  • Pip
  • 114 posts
  • Gender:Male
  • Location:Leeds, UK

Posted 06 September 2007 - 01:22 PM

Cheers RC, this seems to be what I needed :blink:





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users