Filkor
Filkor

Reputation: 642

Apache mod_rewrite, RewriteCond issue

At this question: mod rewrite to remove file extension, add trailing slash, remove www and redirect to 404 if no file/directory is available

In the solution I see this:
RewriteCond %{DOCUMENT_ROOT}/$1.php -f

Could you please someone explain what $1 means here???

(If the question title is not appropriate, please change it, thanks.)

Upvotes: 0

Views: 65

Answers (1)

user1269636
user1269636

Reputation:

$1 is the result of the first captured regex previously specified in a RewriteRule statement.

See the official documentation here: http://httpd.apache.org/docs/current/mod/mod_rewrite.html

Upvotes: 1

Related Questions