Jump to content

webcomponents polyfill import 403 error


gebeer
 Share

Recommended Posts

Hello all,

on a new project I want to use https://github.com/stevenrskelton/flag-icon which implements svg icons for country flags via webcomponents import.

In the <head> I import the webcomponents polyfill js and the flag icons html with

<script src="<?php echo $config->urls->templates; ?>bower_components/webcomponentsjs/webcomponents.min.js"></script>
<link rel="import" href="<?php echo $config->urls->templates; ?>bower_components/flag-icon/flag-icon.html">

But I get a 403 error:

NetworkError: 403 Forbidden - http://dev/pwtest/site/templates/bower_components/flag-icon/flag-icon.html

For testing I did:

1. a clean install of html5-boilerplate (not in PW), added flag-icons through bower and linked the resources as above. Here I don't get the 403 error.

2. a clean install of processwire with the blank profile, added flag-icon through bower and linked the resources as above. And here I get the error again.

I did this on 2 different servers. Same result.

I also checked permission of the import file and they are fine (644).

Then I tried to make a demo install on lightning.pw but the service exits with "We're sorry, but something went wrong."

To me this seems to be a ProcessWire related problem.

Maybe somebody can confirm this or has an idea what is happening? Thank you. 

Link to comment
Share on other sites

# Block access to any PHP or markup files in /site/templates/
RewriteCond %{REQUEST_URI} (^|/)(site|site-[^/]+)/templates($|/|/.*\.(php|html?|tpl|inc))$ [OR]

You can't link directly to php, html, tpl, or inc files in the templates directory, or its subfolders.

You'll need to place them somewhere else!

  • Like 1
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...