mod_rewrite, HELP!

danielneridanielneri WP V.I.P.VPS - Virtual Prince of the Server
I've been trying to setup mod_rewrite for the longest time and somehow I manage to screw it up every single time I try.

I want to setup up in this way:
I have a tutorials script, which needs 3 vars as of now. (Cat)(id)(view or not)
So the url looks like this right now - tutorials.php?cat=php&id=1&act=view

I tried setting it up so you can view the following:
/tutorials/ - tutorials.php
/tutorials/php/ - tutorials.php?cat=$1
/tutorials/php/1/ - tutorials.php?cat=$1&id=$2&act=view

But the style sheets would get all messed up and none of the images would get parsed so it was super annoying.

What's the right way to do this?

Thanks!
ban1.gif

Comments

  • LurkinBackLurkinBack Senior Member The Royal RAM
    I had the same problem with one of my scripts. Check your stylesheet link. Once you head into another folder your link would need to change or you would need to put the stylesheet into that folder.

    if you use
    [PHP]
    include ('stylesheet.css');
    [/PHP]
    in your header,when your the page referencing it is
    www.whatever.com/home/page1.php
    
    then your include will actually look in
    www.whatever.com/home/stylesheet.css
    
    for the stylesheet being included

    You would need to use
    [PHP]
    include ('http://www.whatever.com/stylesheet.css');
    [/PHP]
    Or whatever the actual link to the stylesheet was.

    Hope this helps
  • danielneridanielneri WP V.I.P. VPS - Virtual Prince of the Server
    i don't include the stylesheet via php, just the normal meta way.

    i guess putting a single (/) in front of it would fix the problem?
    ban1.gif
  • LurkinBackLurkinBack Senior Member The Royal RAM
    I'm not sure as I haven't used the META way in a while. I usually have more than one included so it's easier to do it the PHP way.

    If it doesn't work then a full link would.
  • danielneridanielneri WP V.I.P. VPS - Virtual Prince of the Server
    alright i'll try it out asap.

    right now im working on a fantastic project that is going to be super stunning when its done...and this time NOBODY has ever heard of it :D

    im so excited!

    anyways thanks lurkinback :)
    ban1.gif
  • LurkinBackLurkinBack Senior Member The Royal RAM
    No problem, I hope it helps.:)
Sign In or Register to comment.