Adding Header Extra Content - Access is denied
Permalink
I am trying to add 2 external stylesheets and 1 external script to only 1 page. When I put them I get "access is denied".
Here's how I'm adding it:
<link rel="stylesheet" href="<?php echo $this->getThemePath(); ?>/css/stylesheet1.css" />
<link rel="stylesheet" href="<?php echo $this->getThemePath(); ?>/css/stylesheet2.css" />
<script src="<?php echo $this->getThemePath(); ?>/js/script.js"></script>
Am I missing something?
Here's how I'm adding it:
<link rel="stylesheet" href="<?php echo $this->getThemePath(); ?>/css/stylesheet1.css" />
<link rel="stylesheet" href="<?php echo $this->getThemePath(); ?>/css/stylesheet2.css" />
<script src="<?php echo $this->getThemePath(); ?>/js/script.js"></script>
Am I missing something?
Where are you adding that code?
In the extra header content attributes field.
You cannot place PHP code there, only HTML.
Hardcode the theme path instead.
Hardcode the theme path instead.
I tried that also and still getting "access denied ". In fact anything I type there is not accepted (random letters etc). Any other ideas? Thanks
I am trying to add content to the extra header and it's not working either. I can type a <!-- comment, or just put words like "what happens when I put something here"
But when I try and do html or scripts, etc. it gives me an "access denied" message.
But when I try and do html or scripts, etc. it gives me an "access denied" message.
<!-- Sets the Logo for Google's Knowledge Graph --> <link rel="alternate" href="tulk.us" hreflang="en-us" /> <script type="application/ld+json"> { "@context": "http://schema.org", "@type": "Organization", "url": "http://tulk.us", "logo": "http://tulk.us/conc/application/files/4814/3472/6019/TLLCICON2BW.png" } </script>
I wonder if its something your host's mod_security is flagging.
Cool. That totally worked. Turned off the module in CPanel and it's working perfectly now.
Thanks!
Thanks!
Ask your web host if your site has triggered mod_security recently, as you are getting Access Denied when inserting HTML into a form.
The mod_security is a problem through my host (Namecheap) as well. I always just start a live chat with them and they fix it. Until I do this I can't add tracking codes, most extra header content, or include certain terms in a page title (like "seo" or "poker", both of which I've had legitimate reasons to use before).
I figured out the Facebook thing btw, I hardcoded it to the page template. Thanks for the help.
I figured out the Facebook thing btw, I hardcoded it to the page template. Thanks for the help.