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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.