Reputation: 2799
What does these code mean? It is from the .htaccess file.
<IfModule mod_deflate.c>
SetOutputFilter DEFLATE
</IfModule>
RewriteEngine on
RewriteRule ^([^./]{3}[^.]*)$ /index.php?page=$1 [QSA,L]
Can someone explain the last line? thank you
Upvotes: 0
Views: 958
Reputation: 1760
I think you wanted to know about the rewrite rule?
^
start the expressoin
^.
any character
/
then slash
{3}
means match previous item 3 times
^.
means match any character
*
means match zero or more of the preceeding expression
$
end the expression
QSA
appends the variables passed to the end
L
means last rule
So match any character and then a slash (three times) and then any characters after it...
So
/a/b/c/myfile.txt
would be rewriten to
/index.php?page=/a/b/c/myfile.txt
and (for example from a login form post)
/a/b/c/myfile.php?username=myname&password=mypassword
would be rewritten to
/index.php?page=/a/b/c/myfile.txt&username=myname&password=mypassword
Upvotes: 1
Reputation: 34078
TheSetOutputFilter DEFLATE compresses traffic sent from the webserver to decrease response time and make the website faster.
The Rewrite Rule uses a regular expression to match a specific pattern in your URL and modify it so that something else happens.
RewriteRule ^([^./]{3}[^.]*)$ /index.php?page=$1 [QSA,L] //expect someone can explain
Here is a resource on URL Rewriting: http://httpd.apache.org/docs/2.0/misc/rewriteguide.html
Upvotes: 0
Reputation: 10583
The mod_deflate module provides the DEFLATE output filter that allows output from your server to be compressed before being sent to the client over the network.
http://httpd.apache.org/docs/2.2/mod/mod_deflate.html
Basically it compresses data sent by apache to then be uncompressed by the browser, reducing the payload sent between server and browser
Upvotes: 1
Reputation: 7380
This:
<IfModule mod_deflate.c>
SetOutputFilter DEFLATE
</IfModule>
means: The output sent to the client will be compressed. See http://httpd.apache.org/docs/2.0/mod/mod_deflate.html
Upvotes: 1