How do I set up mod rewrite to do this?

Posted by Ali on Stack Overflow See other posts from Stack Overflow or by Ali
Published on 2010-04-27T08:35:34Z Indexed on 2010/04/27 9:03 UTC
Read the original article Hit count: 399

Filed under:
|
|

Hi guys heres the scene - I'm building a web application which basically creates accounts for all users. Currently its setup like this the file structure:

root/index.php
root/someotherfile.php
root/images/image-sub-folder/image.jpg
root/js/somejs.js

When users create an account they choose a fixed group name and then users can join that group. Initially I thought of having an extra textbox in the login screen to enter the group the user belongs to login to. BUt I would like instead to have something like virtual folders in this case:

root/group-name/index.php

I heard it can be done with apache mod rewrite but I'm not sure how to do this - any help here?

Basically instead of having something like &group-name=yourGroupName appended to every page I would just like something of the nature above.

© Stack Overflow or respective owner

Related posts about apache

Related posts about mod-rewrite