Location - Match
--001636c92b3ae1909b047a1d03aa
Content-Type: text/plain; charset=ISO-8859-1
Here is one simple looking requirement :
I want to put max-age header of value X on my home page and a value of Y for
rest of my website.
index.html is my default page but remember i cannot put
<LocationMatch "^/index.html">
Header set Cache-Control max-age=X
</LocationMatch>
As people will be hitting my website as : : http://www.abc.com and NOT
http://www.abc.com/index.html
Please suggest.
Now while trying things i came across this :
<LocationMatch "^/[a-z]">
Header set Cache-Control max-age=7200
</LocationMatch>
Ideally it seems that above rule will "NOT" apply to "/" alone. But it does
;-) Now try this :
<LocationMatch "^/([a-h]|[j-z]">
Header set Cache-Control max-age=7200
</LocationMatch>
This one will "NOT" apply to "/" alone. So some how character "i" matches
"/" ;-)
Thanks
Rajwinder Singh
--001636c92b3ae1909b047a1d03aa
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
Here is one simple looking requirement :<br><br>I want to put max-age heade=
r of value X on my home page and a value of Y for rest of my website.<br><b=
r>index.html is my default page but remember i cannot put <br><br><Locat=
ionMatch=A0 "^/index.html"><br>
Header set Cache-Control max-age=3DX<br></LocationMatch><br><br>As pe=
ople will be hitting my website as : : <a href=3D"http://www.abc.com">http:=
//www.abc.com</a> and NOT <a href=3D"http://www.abc.com/index.html">http://=
www.abc.com/index.html</a><br>
<br>Please suggest.<br><br><br>Now while trying things i came across this :=
<br><br><LocationMatch=A0 "^/[a-z]"><br>Header set Cache-Co=
ntrol max-age=3D7200<br></LocationMatch><br><br>Ideally it seems that=
above rule will "NOT" apply to "/" alone. But it does =
;-) Now try this :<br>
<br><LocationMatch=A0 "^/([a-h]|[j-z]"><br>
Header set Cache-Control max-age=3D7200<br>
</LocationMatch><br>
<br>This one will "NOT" apply to "/" alone. So some how=
character "i" matches "/" ;-)<br><br>Thanks<br>Rajwind=
er Singh<br>
--001636c92b3ae1909b047a1d03aa--
Re: Location - Match
--00504502cc2b363ff5047a1e07cd
Content-Type: text/plain; charset=ISO-8859-1
Can't you put "Header set Cache-Control max-age=X" statement inside
<Directory /> stanza?
On Mon, Dec 7, 2009 at 4:49 PM, Rajwinder-office Singh <
rajwinder.makkar.office [at] gmail.com> wrote:
> Here is one simple looking requirement :
>
> I want to put max-age header of value X on my home page and a value of Y
> for rest of my website.
>
> index.html is my default page but remember i cannot put
>
> <LocationMatch "^/index.html">
> Header set Cache-Control max-age=X
> </LocationMatch>
>
> As people will be hitting my website as : : http://www.abc.com and NOT
> http://www.abc.com/index.html
>
> Please suggest.
>
>
> Now while trying things i came across this :
>
> <LocationMatch "^/[a-z]">
> Header set Cache-Control max-age=7200
> </LocationMatch>
>
> Ideally it seems that above rule will "NOT" apply to "/" alone. But it does
> ;-) Now try this :
>
> <LocationMatch "^/([a-h]|[j-z]">
> Header set Cache-Control max-age=7200
> </LocationMatch>
>
> This one will "NOT" apply to "/" alone. So some how character "i" matches
> "/" ;-)
>
> Thanks
> Rajwinder Singh
>
--00504502cc2b363ff5047a1e07cd
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
Can't you put "Header set Cache-Control max-age=3DX" statemen=
t inside <Directory /> stanza?<br><br><br><div class=3D"gmail_quote">=
On Mon, Dec 7, 2009 at 4:49 PM, Rajwinder-office Singh <span dir=3D"ltr">&l=
t;<a href=3D"mailto:rajwinder.makkar.office [at] gmail.com">rajwinder.makkar.off=
ice [at] gmail.com</a>></span> wrote:<br>
<blockquote class=3D"gmail_quote" style=3D"border-left: 1px solid rgb(204, =
204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">Here is one simpl=
e looking requirement :<br><br>I want to put max-age header of value X on m=
y home page and a value of Y for rest of my website.<br>
<br>index.html is my default page but remember i cannot put <br><br><Loc=
ationMatch=A0 "^/index.html"><br>
Header set Cache-Control max-age=3DX<br></LocationMatch><br><br>As pe=
ople will be hitting my website as : : <a href=3D"http://www.abc.com" targe=
t=3D"_blank">http://www.abc.com</a> and NOT <a href=3D"http://www.abc.com/i=
ndex.html" target=3D"_blank">http://www.abc.com/index.html</a><br>
<br>Please suggest.<br><br><br>Now while trying things i came across this :=
<br><br><LocationMatch=A0 "^/[a-z]"><br>Header set Cache-Co=
ntrol max-age=3D7200<br></LocationMatch><br><br>Ideally it seems that=
above rule will "NOT" apply to "/" alone. But it does =
;-) Now try this :<br>
<br><LocationMatch=A0 "^/([a-h]|[j-z]"><br>
Header set Cache-Control max-age=3D7200<br>
</LocationMatch><br>
<br>This one will "NOT" apply to "/" alone. So some how=
character "i" matches "/" ;-)<br><br>Thanks<br><font c=
olor=3D"#888888">Rajwinder Singh<br>
</font></blockquote></div><br>
--00504502cc2b363ff5047a1e07cd--
Re: Location - Match
On Mon, Dec 7, 2009 at 06:49, Rajwinder-office Singh
<rajwinder.makkar.office [at] gmail.com> wrote:
> Here is one simple looking requirement :
>
> I want to put max-age header of value X on my home page and a value of Y =
for
> rest of my website.
>
> index.html is my default page but remember i cannot put
>
> <LocationMatch=C2=A0 "^/index.html">
> Header set Cache-Control max-age=3DX
> </LocationMatch>
>
> As people will be hitting my website as : : http://www.abc.com and NOT
> http://www.abc.com/index.html
>
> Please suggest.
>
>
> Now while trying things i came across this :
>
> <LocationMatch=C2=A0 "^/[a-z]">
> Header set Cache-Control max-age=3D7200
> </LocationMatch>
>
> Ideally it seems that above rule will "NOT" apply to "/" alone. But it do=
es
> ;-) Now try this :
>
> <LocationMatch=C2=A0 "^/([a-h]|[j-z]">
> Header set Cache-Control max-age=3D7200
> </LocationMatch>
>
> This one will "NOT" apply to "/" alone. So some how character "i" matches
> "/" ;-)
>
> Thanks
> Rajwinder Singh
>
Use mod_expires, it will set Cache-Control for you, and use
ExpiresDefault for the default expiry policy:
ExpiresActive On
ExpiresDefault a7200 # or ExpiresDefault "access plus 2 hours"
<Location "/index.html">
ExpiresDefault "access plus <somethingelse>"
</Location>
I use this configuration and it works wonderfully (I use
ExpiresDefault "now" for index.html however).
You can also use ExpiresByType, but it won't be suitable for your case, I t=
hink.
--
Francis Galiegue
ONE2TEAM
Ing=C3=A9nieur syst=C3=A8me
Mob : +33 (0) 683 877 875
Tel : +33 (0) 178 945 552
fge [at] one2team.com
40 avenue Raymond Poincar=C3=A9
75116 Paris
------------------------------------------------------------ ---------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe [at] httpd.apache.org
" from the digest: users-digest-unsubscribe [at] httpd.apache.org
For additional commands, e-mail: users-help [at] httpd.apache.org