Jump to content

bit more help with mod_rewrite


redbullmarky

Recommended Posts

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
Link to comment
https://forums.phpfreaks.com/topic/14669-bit-more-help-with-mod_rewrite/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.