Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 765633
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T16:55:01+00:00 2026-05-14T16:55:01+00:00

Hi guys heres the scene – I’m building a web application which basically creates

  • 0

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.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-14T16:55:02+00:00Added an answer on May 14, 2026 at 4:55 pm

    You can configure Mod Rewrite in a .htaccess file, e.g.

    root/.htaccess:

    RewriteEngine On
    
    #make sure that urls which already represent files or directories are not rewritten
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    
    #update this if the files are not actually in /root
    RewriteBase /root 
    
    RewriteRule ^([^/]+)/(.*\.php)$ $2?group-name=$1 [L,QSA]
    

    So any request matching /[groupname]/[php file] should be re-written to /[php file]?group-name=[groupname].

    • L means this is the last rule, so if it matches don’t continue running other rules
    • QSA means append the original query string (so other GET parameters are still passed to the PHP script)

    You could maybe replace the pattern which matches the groupname ([^/]+) with something more restrictive, e.g. ([a-zA-Z0-9_-]+).

    You can also put the configuration in one of your apache configuration files, which can be faster than parsing the .htaccess file on every request.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Having another tough one here guys, basically I would like to check if a
Hiya guys heres my question: im using mootools and im using this demo-> Drag.Move
Hey guys Im currently trying to get a textbox a select menu and a
Hey guys, PHP and MySQL newguy here. Wrote this php file which display the
Hey guys, I'm stuck again, so where else to go than stackoverflow? So heres
Hello guys i have a little problem i get an error: File C:\Users\kokki\Desktop\gb1\main.py, line
hey guys i am working on android application , i am trying to creat
Hay Guys, I'm new to Android but heres what i want to do. I
Hey guys, first time using stackoverflow. can you guys help me debug? Heres the
I am new to objective-c/cocoa programming. I am making an application which is to

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.