You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by "sieger007@gmail.com" <si...@gmail.com> on 2009/11/02 10:01:56 UTC

Re: [users@httpd] Apache on F11. ANY APPROACH ?excluding images pdfs etc from Https ( ssl ) routing

Hi Folks
Thanks a lot
Can someone please point me to some examples of mod_rewrite  where
images, pdf' and other non html files get re-directed to http instead of
https
I tried this :
 more  /etc/httpd/.htaccess
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteCond %{SERVER_PORT} 443
RewriteRule .*.(gif|GIF|jpg|JPG|JPEG|jpeg|png|PNG|PDF|pdf|DOC|doc|txt|TXT)$
http://$1 [PT]
</IfModule>

but https : // foobar.jpg is not redirected to http : // foobar.jpg

 more /etc/httpd/conf/httpd.conf | grep -i "root"
# with "/", the value of ServerRoot is prepended -- so "logs/foo.log"
# with ServerRoot set to "/etc/httpd" will be interpreted by the
# ServerRoot: The top of the directory tree under which the server's
ServerRoot "/etc/httpd"
# httpd as root initially and it will switch.
ServerAdmin root@localhost
# DocumentRoot: The directory out of which you will serve your
DocumentRoot "/var/www/html"
# This should be changed to whatever you set DocumentRoot to.
#   CacheRoot "/var/cache/mod_proxy"
#    DocumentRoot /www/docs/dummy-host.example.com


I know I am missing something here and all you folks  who know mod_rewrite
out there  have really graduated in apache.I created that .htaccess in the
Documentroot and server-root path both

So please tell me what am I missing
Thanks
Sam




2009/11/1 Iñigo Medina García <im...@grosshat.com>

> I would like to JUST limit https usage to the login window html and ALL
>> other images pdf's not secured html
>> ( one that do not need password ) should use HTTP NOT HTTPS
>> What I cannot really find ( and Apache modules make a graduate course , as
>> I am realizing with all the
>> futile digging in ) is HOW do I tell apache that if you find an image file
>> ( .jpeg or .pdf ) if it comes to
>> https convert all that into http .Has that something to do with rewrite or
>> redirect modules .
>>
>
> Yep. At least that is the way I do it, using rewrite.
>
> Once you start Apache as a secure server all the content is served through
> secure layer. With rewrite sentences you can override that.
>
> ---------------------------------------------------------------------
> 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@httpd.apache.org
>  "   from the digest: users-digest-unsubscribe@httpd.apache.org
> For additional commands, e-mail: users-help@httpd.apache.org
>
>