SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Zealot
    Join Date
    Dec 2010
    1 Post(s)
    0 Thread(s)

    Is this Rewrite Possible and How?

    Hey guys,

    I'm working on a new travel application and I ran into a php issue. I was trying to make my page have ajax bookmarkable links by using the #hashtag. I was going to manipulate the page based on what hashtag was generated on page load, but PHP can't parse the hash tag. Unfortunately, referencing my pages like http://mysite/trips#/home is out! I now decided that I'd like to reference my pages as http://mysite/trips/home but I have no idea how to do it since I don't have a trips directory, nor do I have sub pages? All I have is a trips.php file in my root directory. I know I can change the links in the HTML easily to the newly rewritten URL, but how do I make the pages exist using a rewrite rule? Any suggestions?

  2. #2
    SitePoint Member
    Join Date
    Aug 2012
    0 Post(s)
    0 Thread(s)
    Rewrite the request to call trips.php with a name value pair.

    RewriteRule ^trips/(.*) trips.php?tag=$1


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts