lundi 26 juin 2017

Serve static content from cookieless domain

Trying to fix this problem with my app I ran into another. I have a Laravel app which I deployed to a live domain. Doing some testing I found out that I need to serve static content from a cookieless domain and that's what I did. I created a subdomain (static.exameple.com) which points to the public_html folder. Then I set up a new CNAME in my DNS and changed all my links to point to this new domain to load the css,js etc files. I also added this lines in my htaccess:

# Use Mod_deflate to compress static files


SetOutputFilter DEFLATE  



# Speed up caching
FileETag MTime Size

# Expires
ExpiresActive On  
ExpiresDefault "access plus 366 days"

# Future Expires Headers

Header set Expires "Sat, 27 Dec 2014 23:59:59 GMT"  

Now, this works fine and it loads my files. The problem is with my routes. Some of them point to the correct things (for e.g domain.com/home works fine) but some point to the static domain. (for e.g when I want to open a model it tries to open it from the static.domain.com) What is the problem here? I feel like I'm missing something.



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire