Jump to content


Photo

bit more help with mod_rewrite


  • Please log in to reply
No replies to this topic

#1 redbullmarky

redbullmarky
  • Staff Alumni
  • Advanced Member
  • 2,863 posts
  • LocationBedfordshire, England

Posted 15 July 2006 - 12:51 PM

Hi all

Just hoping to get some help re mod rewrite. I managed to solve the last problem, but now I've got one more I could do with some best-practice advice on, which is handling virtual directories/subdirectories, etc.
For example:

"/redbullmarky" or "/redbullmarky/" should resolve to /profile.php?user=redbullmarky
"/redbullmarky/blogs" should resolve to /blogs/index.php?user=redbullmarky
"/redbullmarky/blogs/123" should resolve to /blogs/index.php?user=redbullmarky&blog=123
"/redbullmarky/something/" should resolve to /whatever.php
etc etc.

so basically, the username is variable, whatever follows is fixed. the problem is just trying to write a condition that will a) ignore any trailing slashes if nothing follows and b) go to correect page without redirecting - ie, i want to keep the nicely formatted URL.
any ideas?
currently i have everything that's not a 'system' file going to a 'redirect.php' file which does the dirtywork, but i want to maintain the clean URL's

any thoughts?

cheers
Mark
"you have to keep pissing in the wind to learn how to keep your shoes dry..."

I say old chap, that is rather amusing!




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users