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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T06:45:50+00:00 2026-05-20T06:45:50+00:00

This would seem to be a simple .htaccess RewriteRule, yet I’m still having issues

  • 0

This would seem to be a simple .htaccess RewriteRule, yet I’m still having issues with it.

Basically, I’d like any text after the domain to be interpreted as index.php?$text, unless of course, that text is a filename.

Example:

http://domain.com/register -> http://domain.com/index.php?register

http://domain.com/images/image.jpeg -> http://domain.com/images/image.jpeg

This is what I have so far:

RewriteRule ^[A-Za-z]+$ index.php?$1

However, it’s not passing the $_GET variable to the PHP page as it should.

Thanks for any help.

EDIT I’m using PHP- so if there is a better scripting method of going about this than .htaccess, let me know.

  • 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-20T06:45:51+00:00Added an answer on May 20, 2026 at 6:45 am

    Add the QSA flag to your rewrite rule so it would look something like

    RewriteRule ^[A-Za-z]+$ index.php?$1 [QSA]
    

    QSA (query string addition) adds the query string onto your rewrite results. so any $_GET’s will get appended onto what gets passed to your php script.

    You might think about adding the L flag too, especially if thats all your trying to do with the rewrite. It tells the processor that if this rule processes its the end of the rewrite.

    So it would look like

    RewriteRule ^[A-Za-z]+$ index.php?$1 [QSA,L]
    

    I often add NC as well, which makes it case insensitive so you don’t have to handle both upper and lower case like you’re doing in your regex.

    Another thing to keep in mind is that you’re not passing $1 as a proper get var. it would be better to name the var that its coming in on. And I just noticed that you’re not creating the $1 var in the first place. Try this.

    RewriteRule ^([A-Za-z]+)$ index.php?urlRequest=$1 [QSA,L]
    

    Then check it in your index.php

    echo $_GET['urlRequest'];
    

    Hope that helps!

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

Sidebar

Related Questions

Has any one done this before? It would seem to me that there should
This may seem to be an academic question, but still I would be very
I have this design which I cannot seem to get right, I would like
I thought this would be simple but I can't seem to find a variable
All, This would seem like a fairly basic asp.net question - but in all
It would seem that this would be a simple thing to do, but I
I thought this would be simple, but searching Google didn't seem to help. I'm
This would seem to be super simple but I cannot get it to work
I thought this would be a relatively simple task with something like FMOD, but
This would seem to be the case in Firefox 3.5+, there I can instantiate

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.