htaccess and php woes

Discussion in 'Web Design and Development' started by tominated, Jun 24, 2008.

  1. tominated macrumors 68000

    tominated

    Joined:
    Jul 7, 2006
    Location:
    Queensland, Australia
    #1
    Ok, If you don't know from my previous 2 threads, I'm making a site for a client and want to use php includes. I got that done, but I wanted friendly urls, not ones that show up like "www.blah.com/index.php?blah=blah" (it would show up like "www.blah.com/blah" with friendly urls). I found this tutorial to do just that, but I have come across a problem, yet agin. The htaccess file works fine and dandy, but it's the fix for when a user puts a trailing slash after the url. I tried the following and it worked, but there were no css styles applied when the slash was put in:
    PHP:
    $page ereg_replace("[^a-z]"""$page); 
    Any ideas? BTW: my htaccess is exactly how it says in the tut
     
  2. SrWebDeveloper macrumors 68000

    SrWebDeveloper

    Joined:
    Dec 7, 2007
    Location:
    Alexandria, VA, USA
    #2
    I found that tutorial to be written very poorly, citing examples that do one thing, then addressing obvious situations that requires change in the code, i.e. users adding slashes on the end of URL's. That should have been included in the first example, for crying out loud.

    I noticed a section in the tutorial called "Small Issues" if you scroll almost all the way down, addressing "First off, if you go to http://example.com/about the rule works, but if you go to http://example.com/about/ then nothing matches - our p variable has changed with that one character!" which seems to be your situation.

    They have a fix outlined there so I am guessing you need to do that.

    If not, nevermind!!!!

    -jim
     
  3. tominated thread starter macrumors 68000

    tominated

    Joined:
    Jul 7, 2006
    Location:
    Queensland, Australia
    #3
    thing is, I'm using a different method to how they reference the files, but i'll try it their way and see how it goes. thanks anyway.
     

Share This Page