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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T04:18:37+00:00 2026-05-11T04:18:37+00:00

I only recently found out about URL rewriting , so I’ve still got a

  • 0

I only recently found out about URL rewriting, so I’ve still got a lot to learn.

While following the Easy Mod Rewrite tutorial, the results of one of their examples is really confusing me.

RewriteBase / RewriteRule (.*) index.php?page=$1 [QSA,L] 

Rewrites /home as /index.php?page=index.php&page=home.

I thought the duplicates might have had been caused by something in my host’s configs, but a clean install of XAMPP does the same.

So, does anyone know why this seems to parse twice?

And, to me this seems like, if it’s going to do this, it would be an infinite loop — why does it stop at 2 cycles?

  • 1 1 Answer
  • 2 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. 2026-05-11T04:18:38+00:00Added an answer on May 11, 2026 at 4:18 am

    From Example 1 on this page, which is part of the tutorial linked in your question:

    Assume you are using a CMS system that rewrites requests for everything to a single index.php script.

    RewriteRule ^(.*)$ index.php?PAGE=$1 [L,QSA] 

    Yet every time you run that, regardless of which file you request, the PAGE variable always contains "index.php".

    Why? You will end up doing two rewrites. Firstly, you request test.php. This gets rewritten to index.php?PAGE=test.php. A second request is now made for index.php?PAGE=test.php. This still matches your rewrite pattern, and in turn gets rewritten to index.php?PAGE=index.php.

    One solution would be to add a RewriteCond that checks if the file is already "index.php". A better solution that also allows you to keep images and CSS files in the same directory is to use a RewriteCond that checks if the file exists, using -f.


    1the link is to the Internet Archive, since the tutorial website appears to be offline

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

Sidebar

Related Questions

Recently i've found myself writing a lot of methods with what i can only
I've recently found out about protocol buffers and was wondering if they could be
I recently found out that PHP not only has the fsock* functions, but also
Recently I was checking up on some AI possibilities and found out about babel-lang
I recently found out about the so-called easter egg URLs in PHP: These are
I recently found a code to send emails using python. It was only for
Note: I originally asked this question about an hour ago but only recently realized
I have only started learning python recently. I would still be considered a beginner.
I've been using eval in my code and I recently found out that there
I've only just recently learned about Google's programming language, Go. I've been intrigued by

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.