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

  • Home
  • SEARCH
  • 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 7957225
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T04:13:03+00:00 2026-06-04T04:13:03+00:00

I have software with student, teacher and admin part. I want to allow teacher

  • 0

I have software with student, teacher and admin part. I want to allow teacher to choose their web address such as http://mydomain.com/teacher1, http://mydomain.com/teacher2 etc.

How can I use this mod_rewrite for that? This part is working:

RewriteEngine On
RewriteRule username teacher/ 

but not when I have some link in teacher dir such as teacher/training.php browser open index.php page in teacher/dir instead of training.php.

  • 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-06-04T04:13:04+00:00Added an answer on June 4, 2026 at 4:13 am

    mod_rewrite reads all of the path and modifies it all. The format is: “RewriteRule pattern substitution” (Apache Docs)

    “Pattern” can be a substring and anything that matches that substring will be rewritten, but “substitution” is the full path.

    Assuming that you want “username” to only match at the start, and assuming that all locations under it must be rewritten, what you need is:

    RewriteEngine On
    RewriteRule ^username(/(.*))? teacher$1
    

    That will ignore “username” but append the rest of the path on the end, so http://example.com/username/training.php would show the content for (but not change the address to) http://example.com/teacher/training.php. If you want it to do a full redirect so that the URL changes, add [R=301] at the end of the RewriteRule line.

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

Sidebar

Related Questions

We have a software house developing code for us on a project, .NET Web
We have software that have some features that are so sensitive that we want
I am a student and have to build a flex air desktop software using
I have recently edited a fellow student's data collection software to my specifications. The
I am software engineering student, and we have assignment to create a system, which
I have software<-m:n->tag where software is main part of the relationship (tag has mappedby=softwares
We have software that runs fine under a normal Windows installation but when we
I have a software that is tracking an NTFS volume changes on a Windows
We have accounting software populating the name field on a magento webstore, the problem
We have this software that has a webservices component. Now, the administrator of this

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.