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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T22:51:50+00:00 2026-05-26T22:51:50+00:00

i searched a lot on SOF about .htaccess and mod_rewrite and i want to

  • 0

i searched a lot on SOF about .htaccess and mod_rewrite and i want to performance wise which one is faster:

RewriteRule ^([a-z0-9]+)/?$ index.php?id=$1 [NC,L]
RewriteRule ^(.*)/?$ index.php?id=$1 [NC,L]
RewriteRule ^([^/]*)/?$ index.php?id=$1 [NC,L]

since the first one only accepts letters and numbers does it make it faster to execute?

  • 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-26T22:51:51+00:00Added an answer on May 26, 2026 at 10:51 pm

    When in doubt, test it out. I setup a test server running Ubuntu 2011.10 with Apache2 and used the siege load testing app to perform 3 tests. The test ran for 1 minute (or until 5000 failures) with 50 concurrent users requesting ‘/index.html’

    Test #1 used the following rewrite rule configuration:

    RewriteEngine on
    RewriteRule ^([a-z0-9]+)/?$ /index.html?id=$1 [NC,L]
    

    The results from siege:

    Transactions:                 300970 hits
    Availability:                  98.36 %
    Elapsed time:                  57.25 secs
    Data transferred:              20.38 MB
    Response time:                  0.00 secs
    Transaction rate:            5257.12 trans/sec
    Throughput:                     0.36 MB/sec
    Concurrency:                    9.04
    Successful transactions:      300970
    Failed transactions:            5009
    Longest transaction:            0.02
    Shortest transaction:           0.00
    

    Test #2 with a rewrite rule configuration:

    RewriteEngine on
    RewriteRule ^(.*)/?$ /index.html?id=$1 [NC,L]
    

    The results:

    Transactions:                 225244 hits
    Availability:                  97.82 %
    Elapsed time:                  42.43 secs
    Data transferred:              15.25 MB
    Response time:                  0.00 secs
    Transaction rate:            5308.60 trans/sec
    Throughput:                     0.36 MB/sec
    Concurrency:                    8.71
    Successful transactions:      225244
    Failed transactions:            5009
    Longest transaction:            0.18
    Shortest transaction:           0.00
    

    Test #3 with the following rewrite rule:

    RewriteEngine on
    RewriteRule ^([^/]*)/?$ /index.html?id=$1 [NC,L]
    

    The results:

    Transactions:                 210469 hits
    Availability:                  97.68 %
    Elapsed time:                  39.39 secs
    Data transferred:              14.25 MB
    Response time:                  0.00 secs
    Transaction rate:            5343.21 trans/sec
    Throughput:                     0.36 MB/sec
    Concurrency:                    8.60
    Successful transactions:      210469
    Failed transactions:            5009
    Longest transaction:            0.02
    Shortest transaction:           0.00
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Searched a lot about this problem but never found a answer, that solved it.
I searched a lot but I can't find an answer. In my contact.php I
I have searched a lot about the difference between Website and WebApplication but didn't
I have searched a lot about this topic and I can't get this code
I searched a lot but could not find a way to dump table relations
I have searched a lot and couldn't found the approach to create the small
I have searched a lot trying to find something for my purpose, however most
I've searched a lot for this on google, but without luck... Basically I need
firstly i have searched a lot and all topics seems to be C# :
I've searched a lot within SO but I can't find the right answer for

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.