I have a search page located at http://www.example.com/search_result.php, and I’m mod_rewriting it to be http://www.example.com/search-result.
Basically, I want to do what the History.js demo does – append an arbitrary string to the end of the URL (with a # if it’s a HTML4 browser). The demo works great in my browser’s – however, my site’s <base> tag points to the root directory on all pages, and I think that’s what’s breaking my site’s behaviour.
Here’s what happens: If my rewritten URL ends with a /, HTML4 browsers go into an infinite URL loop of appending the string to the end of the URL. If it doesn’t, I lose the search-result portion of my URL in HTML5 browsers, and adding "search-result/ to the statement also adds it after the # in HTML4 browsers.
And If I change the base tag, the page looks for its files (CSS, JS, images, everything) in the nonexistent directory of /search-result/. So I’m screwed.
So, how do I fix this? Or should I be looking for another library? There’s RSH, but it hasn’t been updated since 2007…
Could you use something like this where you exclude specific directories from the rewrite?