Mobile app version of vmapp.org
Login or Join
Harper822

: Reach only one file through :80 I have an owncloud server which is using HTTPS (www/owncloud). I redirected all HTTP request to HTTPS. Now I need to reach one file using HTTP (www/other/directory/file.txt).

@Harper822

Posted in: #Security

I have an owncloud server which is using HTTPS (www/owncloud). I redirected all HTTP request to HTTPS.
Now I need to reach one file using HTTP (www/other/directory/file.txt). How can I achive this without making any other files reachable through HTTP?

Thanks in advance!

10.01% popularity Vote Up Vote Down


Login to follow query

More posts by @Harper822

1 Comments

Sorted by latest first Latest Oldest Best

 

@Jamie184

Redirect permanent / mysite/owncloud


You'll need to change this to mod_rewrite in order to implement an exception for the URL you want to keep on HTTP. For example:

RewriteEnging On
ReeriteCond %{REQUEST_URI} !^/other/directory/file.txt
RewriteRule (.*) mysite/owncloud/ [R,L]


I've assuming www is your document root (from your redirect) and so /other is a root-relative URL, relative to this document root?

This is also a temporary (302) redirect, so change R to R=301 when you are sure it's working OK.

You'll need to make sure your browser cache is clear before testing.

10% popularity Vote Up Vote Down


Back to top | Use Dark Theme