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 6024929
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T04:13:42+00:00 2026-05-23T04:13:42+00:00

Essentially my problem is thus; I have a MVC system that redirects all requests

  • 0

Essentially my problem is thus; I have a MVC system that redirects all requests to index.php on my site. I have a rewrite rule in my htaccess file to handle those requests like so:

RewriteRule ^([a-zAZ\_\-]+)\/([a-zA-Z\_\-]+)\/([^\/?]*) /?module=$1&class=$2&event=$3

Which translates urls into these type of urls

http://example.com/users/login/
http://example.com/users/info/me

My problem is that I also want GET variables to be applied and used in the URL like so

http://example.com/users/login/?var1=val1&var2=val2
http://example.com/users/info/me?var1=val2...

I’ve written two different regexes that work perfectly well in a my workbench (expresso) and I’ve tested them out in PHP however they refuse to work in htaccess. They’re not particular complex, I have tried:

^([a-zAZ_\-]+)\/([a-zA-Z_\-]+)\/([^\/\?]*)[\?]*(.*) /?module=$1&class=$2&event=$3&$4
and
^([a-zAZ_\-]+)\/([a-zA-Z_\-]+)\/([^\/\?]*)(?(?=\?)\?(.+)) /?module=$1&class=$2&event=$3&$4

Neither of these work and I’m racking my brains as to why. Essentially it just doesn’t recognise the fourth group and returns nothing I thought it might have been due to it being next to an ampersand but I did &var=$4 as a test and it still fell over.

Any help with this would be greatly appreciated as this is driving me insane.

Thanks in advance,
Rupert S.

  • 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-23T04:13:43+00:00Added an answer on May 23, 2026 at 4:13 am

    After all, this is what you need:

    RewriteRule ^([a-z_-]+)/([a-z_-]+)/([^/?]*) /?module=$1&class=$2&event=$3 [QSA,NC,L]
    

    [QSA] will append the additional GET parameters to the rewritten query string.

    [NC] since it is case insensitive, no need for A-Z matches

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

Sidebar

Related Questions

Heres the problem. I have an app that is essentially an image gallery, it
I essentially want to spider my local site and create a list of all
I have essentially a survey that is shown, and people answer questions a lot
This question comes from a range of other questions that all deal with essentially
I am using the jQuery form validation plugin. The problem I have is that
Hi all SQL Server Blackbelt masters out there. I have a simple question that
I have an SQLite question which essentially boils down to the following problem. id
Essentially, I have to get a flat file into a database. The flat files
I have what is essentially a jagged array of name value pairs - i
So What I'm essentially trying to do is have something happen 70% of the

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.