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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T07:07:01+00:00 2026-06-09T07:07:01+00:00

Here is my mod_rewrite configuration: RewriteEngine On RewriteCond expr true RewriteRule .? – [L]

  • 0

Here is my mod_rewrite configuration:

RewriteEngine On
RewriteCond expr "true"
RewriteRule .? - [L]

RewriteRule ^(.*)$ $1 [QSA,L]

And here the relevant logging output:

RewriteCond: input='expr' pattern='true' => not-matched

The Apache documentation says

Syntax: RewriteCond TestString CondPattern

If the TestString has the special value expr, the CondPattern will be
treated as an ap_expr.

In the below example, -strmatch is used to compare the REFERER against
the site hostname, to block unwanted hotlinking.

RewriteCond expr "! %{HTTP_REFERER} -strmatch '*://%{HTTP_HOST}/*'"
RewriteRule ^/images - [F]

So if CondPattern will be treated as ap_expr and ap_expr can per definition explicitly be true then why the hell does the simplest possible expression fitting into that pattern not work? To be exact no matching expression works for me. Is anyone out there who can verify that this technique ever worked for anyone?

Because I actually have a pretty complex expression which can not be done with conventional mod_rewrite conditions, it is very important to me to know whether I can use this method anyhow.

EDIT:

For the lazy ones, here the BNF definition of ap_expr directly copied from here:

expr        ::= "true" | "false"
              | "!" expr
              | expr "&&" expr
              | expr "||" expr
              | "(" expr ")"
              | comp
  • 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-09T07:07:02+00:00Added an answer on June 9, 2026 at 7:07 am

    Are you sure you’re using apache 2.4? The ap_expr stuff is all new features that are part of the 2.4 feature set and not a part of 2.2.

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

Sidebar

Related Questions

Here is code: <IfModule mod_rewrite.c> RewriteEngine On RewriteCond %{REQUEST_URI} !^/rt/ RewriteRule ^(.*)$ /rt/$1 [L]
Here are the rules: <IfModule mod_rewrite.c> RewriteEngine on RewriteRule ^$ index.php?action=home [L] RewriteRule ^[\w\W]*$
Here is my .htaccess file: Options +FollowSymlinks RewriteEngine on Rewritecond %{http_host} ^mysite.com [nc] Rewriterule
Here's what I have: <VirtualHost 127.0.0.1> DocumentRoot D:\XAMPP\xampp\htdocs\mysites\tupega.com ServerName tupega.tld <IfModule mod_rewrite.c> RewriteEngine on
What is the difference in mod_rewrite between Apache 1.3(.37) and 2.2(.11)? RewriteEngine On RewriteCond
I have a strange problem with mod_rewrite, the rules that are relevant here are:
I'm writing a mod_rewrite script. Here's my .htaccess file thus far: RewriteEngine On Options
I've enabled mod_rewrite, restarted all services, still not taking affect. Here's what I have
here is my configuration: http://domain.com (obviously fictitious name...) hosted on a server running Apache
here's how I do : the user types a URL the mod_rewrite handles URLs

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.