Server Side Includes are not being shown - ssi

I've gone through every fix online I'm pretty sure but I just can't seem to get this to work. I'm trying to have <#include virtual="footer.ssi" but not matter what it doesn't work.
footer.ssi and the page are in the same place
I really have no clue how to fix this issue but I can't get ANY server sides to show up on any of my pages so I know it's on my end. If anyone has any thoughts they're greatly appreciated!

I believe your code should be this: <!--#include virtual="footer.ssi" -->, this is what I use on my website, and it works perfectly!
See this reference: Html Goodies, and scroll down to The File Argument section.

Related

Regex specific question and search function on my website dealing with broken links

I've been trying to figure out my regex pattern but it doesn't seem to be working for me.
Here's what i'm trying to do:
I have broken links on my website if someone accidentally gets to a page like so:
https://example.com/catalogsearch/result/?q=
or
https://example.com/catalogsearch/result/
So i'm redirecting them back to my homepage. The problem is now the search is just sending everything back to the homepage. So i'm assuming if there is something after the equals it needs to continue the search.. obviously
https://example.com/catalogsearch/result/?q=person
but currently i can't figure this out..
Here is my regex that i've been messing with for quite sometime now... still seems to be wrong or something else is wrong with my search.
"^/catalogsearch/result((/)|(/\\?)|(/\\?[a-z])|(/\\?[a-z]=))?$"
Please forgive me i'm horrible with regex.
After a lot of discussion, it is concluded that the routes.yaml will consider the url path as a valid route but not the query string part. Hence out of the two examples in the post, you can use
"/catalogsearch/result": { to: "https://example.com/", prefix: false }
and for other one please change it in nginx config to redirect to homepage or if its not possible then check with magento support on how to incorporate the query string part in routes.yaml file.

Selecting a data-ng-bind with selenium for python

I'm trying to get the 0 value in this bit of code but can't seem to get it.
<div class="visits-column table-cell ng-binding" data-ng-bind="item.viewCounter">0</div>
I tried by xpath which does not work because the id seems to change when the value does.
I tried with css selector but it also does not work
browser.find_element_by_xpath(".//*[#id='msg-1239608978']/div[6]")
browser.find_element_by_css_selector('visits-column table-cell ng-binding').value (I also tried .text but it also does not work)
Would I have to do it by regex or is there something I'm missing ?
I tried looking for ng-binding but couldn't find much information relevant to my problem apart from giving time for the page to load
Thank you very much :) !
The css selector in your try is incorrect, you can try
browser.find_element_by_css_selector('.visits-column.table-cell.ng-binding')
.text on the above element might give the required value but you might have to play around with it.

POST http://exaple.com/index.php?route=checkout/cart/add 500 (Internal Server Error)

I am new to opencart. Some how I managed to create a website after reading online tutorial.
The website was worked well, but since two day the add to cart button is not working. Its showing some error on console. I tried different browser but same result.
Here I attached the screenshot.
The website is posakaworld.com
Any tips or hint is appreciated :)
I also having the similar issue, please check your
system/log/error.txt
For my case, I installed a new extension, and it shows and error
2017-06-25 9:49:03 - PHP Notice: Undefined variable: checkCart in /Users/Shiro/Sites/opencart/vqmod/vqcache/vq2-catalog_controller_checkout_cart.php on line 724
When I check ajax response, it does not show the error, it is due to production display error off, so finally, I manage to find out it is just a PHP Notice can break the system.
Once I fix the undefined variable notice, my ajax no more error. Everything back to normal. I hope this solution is helped.

content empty when using scrapy

Thanks for everyone in advance.
I encountered a problem when using Scrapy on Python 2.7.
The webpage I tried to crawl is a discussion board for Chinese stock market.
When I tried to get the first number "42177" just under the banner of this page (the number you see on that webpage may not be the number you see in the picture shown here, because it represents the number of times this article has been read and is updated realtime...), I always get an empty content. I am aware that this might be the dynamic content issue, but yet don't have a clue how to crawl it properly.
The code I used is:
item["read"] = info.xpath("div[#id='zwmbti']/div[#id='zwmbtilr']/span[#class='tc1']/text()").extract()
I think the xpath is set correctly and I have checked the return value of this response and it indeed told me that there is nothing under this directory. Results shown here:'read': [u'<div id="zwmbtilr"></div>']
If it has something, there should be something between <div id="zwmbtilr"> and </div>.
Really appreciated if you guys share any thoughts on this!
I just opened your link in Firefox with NoScript enabled. There nothing inside the <div #id='zwmbtilr'></div>. If I enable the javascripts, I can see the content you want. So, as you already new, it is a dynamic content issue.
Your first option is try to identify the request generated by javascript. If you can do that, you can send the same request from scrapy. If you can't do it, the next option is usually to use some package with javascript/browser emulation or someting like that. Something like ScrapyJS or Scrapy + Selenium.

URL redirect plugin regex input for match and target

I'm panicking a little, so sorry if I haven't explained well enough.
I've dealt with quite the nightmare of a permalink restructuring experience
Old permalink= sitename/archives/postid
desired new= sitename/postname
tried everything it seems. I've even dabbled with /?p=$1 (<-----that nonsense!). But now i'm getting some crazy error when i go to my old permalink structure that reads:
Oops! Google Chrome could not connect to 0.0.37.89
Suggestions:
Try reloading: 0.­0.­37.­89
and this was supposed to be "redirected".
I give up. please help.
sitename= brightontheday.com
I used the redirection plugin to redirect all old URL permalinks (/archives/postID) to the new permalink (/postID/postname)
also, the issue appeared to be due to cashing via cloudfare. It's important to to note that one should put cloudfare in "developer mode" while making site wide changes.