Forum Moderators: phranque

Message Too Old, No Replies

why isn't this .htaccess working

         

jboy

10:51 am on Feb 7, 2011 (gmt 0)

10+ Year Member



I have a file like so:
subdomain.domain.com/dir/file.css.php

I have a rewrite to go from
subdomain.domain.com/dir/file.css
to
subdomain.domain.com/dir/file.css.php
which works fine.

In subdomain.domain.com/.htaccess if I put:

SetOutputFilter DEFLATE


and then access subdomain.domain.com/dir/file.css in a browser it's compressed fine.

If I move the compression line from
subdomain.domain.com/.htaccess
to a new .htaccess file here:
subdomain.domain.com/dir/.htaccess
then compression doesn't work for accesses to subdomain.domain.com/dir/file.css (nor direct accesses to subdomain.domain.com/dir/file.css.php bypassing the rewrite for that matter).

Why isn't the compression line working when it's here
subdomain.domain.com/dir/.htaccess
but is working fine when it's here:
subdomain.domain.com/.htaccess
?

Thanks.

jdMorgan

10:44 pm on Feb 7, 2011 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Three threads so far, and a critical piece of information is still missing... Is /dir/file.css.php a physically-existing file or not? If not, how is this css "file" generated, and where does this generation take place (i.e. if it's done by a script, then what is the server filepath to that script).

You've got a complicated set-up here, and compression problems always seem to get complicated even on the simplest set-ups...

Jim

jboy

10:56 pm on Feb 7, 2011 (gmt 0)

10+ Year Member



> Is /dir/file.css.php a physically-existing file or not?

Yes. It's a normal php file in that location, on a subdomain that is:
subdomain.domain.com/dir/file.css.php
is an actual PHP script file.

So just to make absolutely clear, this is not a real file, it's the intended address to use externally:
subdomain.domain.com/dir/file.css

And accesses to subdomain.domain.com/dir/file.css from the outside get rewritten internally to:
subdomain.domain.com/dir/file.css.php
which is the php file on the server.

Thanks.