Rewrite main.css to main-min.css

Rewrite main.css to main-min.css

am 05.10.2010 16:27:52 von ben short

Hi,

Is it possible to use mod_rewrite to alter a request for main.css to
main-min.css?

Regards

Ben Short

------------------------------------------------------------ ---------
The official User-To-User support forum of the Apache HTTP Server Project.
See for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
" from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org

Re: Rewrite main.css to main-min.css

am 06.10.2010 05:34:13 von Craig Huffstetler

> Is it possible to use mod_rewrite to alter a request for main.css to
> main-min.css?

Yes, but for some reason I think this is more complex. However, I will
answer given the scope given:

If mod_rewrite is active then add this to .htaccess:

RewriteEngine on
RewriteRule main.css main-min.css

There are no directories or special rules for this, Ben? I don't quite
understand why you even need to use mod_rewrite in this case.

Craig

------------------------------------------------------------ ---------
The official User-To-User support forum of the Apache HTTP Server Project.
See for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
" from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org

Re: Rewrite main.css to main-min.css

am 06.10.2010 10:29:15 von ben short

Hi Craig,

Some background...

As part of the build process my web application minimizes and gzips
all the style sheets and javascript files.

So I end up with main.css main-min.css and main-min.css.gz.

The web page will make a request for main.css but I need to use
rewrite to return then main-min.css.gz file.

Ben


On 6 October 2010 04:34, Craig Huffstetler wr=
ote:
>> Is it possible to use mod_rewrite to alter a request for main.css to
>> main-min.css?
>
> Yes, but for some reason I think this is more complex. However, I will
> answer given the scope given:
>
> If mod_rewrite is active then add this to .htaccess:
>
> RewriteEngine on
> RewriteRule main.css main-min.css
>
> There are no directories or special rules for this, Ben? I don't quite
> understand why you even need to use mod_rewrite in this case.
>
> Craig
>
> ------------------------------------------------------------ ---------
> The official User-To-User support forum of the Apache HTTP Server Project=
..
> See for more info.
> To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
> =A0 " =A0 from the digest: users-digest-unsubscribe@httpd.apache.org
> For additional commands, e-mail: users-help@httpd.apache.org
>
>

------------------------------------------------------------ ---------
The official User-To-User support forum of the Apache HTTP Server Project.
See for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
" from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org

Re: Rewrite main.css to main-min.css

am 06.10.2010 11:19:40 von ben short

Never mind,

I altered my build to not include the main.css and name the
main-min.css main.css.

Thanks

On 6 October 2010 09:29, Ben Short wrote:
> Hi Craig,
>
> Some background...
>
> As part of the build process my web application minimizes and gzips
> all the style sheets and javascript files.
>
> So I end up with main.css main-min.css and main-min.css.gz.
>
> The web page will make a request for main.css but I need to use
> rewrite to return then main-min.css.gz file.
>
> Ben
>
>
> On 6 October 2010 04:34, Craig Huffstetler =
wrote:
>>> Is it possible to use mod_rewrite to alter a request for main.css to
>>> main-min.css?
>>
>> Yes, but for some reason I think this is more complex. However, I will
>> answer given the scope given:
>>
>> If mod_rewrite is active then add this to .htaccess:
>>
>> RewriteEngine on
>> RewriteRule main.css main-min.css
>>
>> There are no directories or special rules for this, Ben? I don't quite
>> understand why you even need to use mod_rewrite in this case.
>>
>> Craig
>>
>> ------------------------------------------------------------ ---------
>> The official User-To-User support forum of the Apache HTTP Server Projec=
t.
>> See for more info.
>> To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
>> =A0 " =A0 from the digest: users-digest-unsubscribe@httpd.apache.org
>> For additional commands, e-mail: users-help@httpd.apache.org
>>
>>
>

------------------------------------------------------------ ---------
The official User-To-User support forum of the Apache HTTP Server Project.
See for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
" from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org

Re: Rewrite main.css to main-min.css

am 06.10.2010 14:07:16 von i.galic

----- "Craig Huffstetler" wrote:

> > Is it possible to use mod_rewrite to alter a request for main.css
> to
> > main-min.css?
>=20
> Yes, but for some reason I think this is more complex. However, I
> will
> answer given the scope given:
>=20
> If mod_rewrite is active then add this to .htaccess:

No. Don't. If you have access to the httpd.conf you
should not, NEVER, put ANYTHING in .htaccess

> RewriteEngine on
> RewriteRule main.css main-min.css
>=20
> There are no directories or special rules for this, Ben? I don't
> quite
> understand why you even need to use mod_rewrite in this case.
>=20
> Craig
>=20
> ------------------------------------------------------------ ---------
> The official User-To-User support forum of the Apache HTTP Server
> Project.
> See for more info.
> To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
> " from the digest: users-digest-unsubscribe@httpd.apache.org
> For additional commands, e-mail: users-help@httpd.apache.org

--=20
Igor Galić

Tel: +43 (0) 664 886 22 883
Mail: i.galic@brainsware.org
URL: http://brainsware.org/

------------------------------------------------------------ ---------
The official User-To-User support forum of the Apache HTTP Server Project.
See for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
" from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org