0

I want to use google drive to share static content to my site. How can I use htaccess to do that? I only want to rewrite addresses for image, css and js files, so rest of the files from root folder should be serve from main server.

For example, I want to rewrite www.adress.pl/template/mytemplate/image.jpg

www.adress.pl/template/mytemplate/css/some.css

to:

googledrive.com/host/0B4zbBxGUyY4NRFVlVU5/image.jpg

googledrive.com/host/0B4zbBxGUyY4NRFVlVU5/css/some.css

Is it possible?

2
  • Provide more examples for css/js redirections also. Commented Sep 21, 2014 at 17:42
  • Added in firs post. Folder in google drive will be always same. 80% of files are in this folder www.adress.pl/template/mytemplate/(or subfilders in it) so it shoud be enough for start. For the rest of files - if i knew the rule, i should be able to adapt it to the rest of folders Commented Sep 21, 2014 at 17:55

1 Answer 1

1

You can have this rule as first rule in your root .htaccess:

RewriteEngine On

RewriteRule ^template/mytemplate/(.+)$ http://googledrive.com/host/0B4zbBxGUyY4NRFVlVU5/$1 [L,NC,R=301,NE]
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.