php: configure Nginx to run PhalconPHP in a subfolder

I want to run a PhalconPHP application in a subfolder like this

A fragment of my Nginx configuration is the following …

location ^ ~ / simon / apps / phalconapp {

root /var/www/;
index index.php index.html index.htm;
try_files $ uri $ uri / @rewrite;

location ~  .php $ {

fastcgi_index index.php;

includes fastcgi_params;

fastcgi_split_path_info ^ (. + . php) (/.+) $;
fastcgi_param PATH_INFO $ fastcgi_path_info;
fastcgi_param PATH_TRANSLATED $ document_root $ fastcgi_path_info;
fastcgi_param SCRIPT_FILENAME $ document_root $ fastcgi_script_name;



location @rewrite {
rewrite ^ / (. *) $ /index.php?_url=/$1;

However, I get a file not Found Error trying to access the application. What could I be doing wrong?

service worker – navigator.serviceWorker.ready does not fire when it is placed in the subfolder

Our application is served (by IIS in a virtual application) from

The HTML returned from is:


To register the service worker, I need to add the subfolder as shown below

// This does not work since the application is served from / myapp
navigator.serviceWorker.register ("/ sw.js") // Fail, will try to load

// This works (successful registration)
navigator.serviceWorker.register ("/ myapp / sw.js") // This will register the sw.

The problem occurs when I try to use the service worker, who is waiting for the ready event:

// Inside file.js
navigator.serviceWorker.ready.then (...) // Will not fire

I guess what is happening is that the ready event does not trigger because the service worker "thinks" that it is being installed from a subfolder called "MyApp", but when the .js file is executed and tries to use the service worker, it looks like the .js file is served from the root and, therefore, is beyond the reach of the service worker.

Any ideas on how to handle this? I tried to use the scope parameter, but I think it's only used to limit the scope, not to expand it.

{scope: & # 39; / & # 39;} // Fail with an external root error
{scope: & # 39; / MyApp & # 39;} // It works, but there's still no event ready

I'm sure I'm missing something here, but I have no idea what it is.

Thanks for any help


.htaccess: How to add / ignore a subfolder in the htaccess file?

I have built an application in http: // url / sdf19 /

I have a .htaccess placed in / sdf19 / containing RewriteRule for clean URLs.

But I have built a PDF generation tool, which is in a subfolder / inc / tools.
I need to link it directly to run before the headers.

Despite some hours of searching, testing fragments, generators, etc. I can not get any request for http: // url / sdf19 / inc / tools to be allowed, without the existing RewriteRule set taking control

Here is my home file


RewriteRule ^ ([a-z]+)  /? $ index.php? page = $ 1 [NC]
RewriteRule ^ ([a-z]+)  / ([0-9]+)  /? $ index.php? page = $ 1 & id = $ 2 [NC]
RewriteRule ^ ([a-z]+)  / ([a-z]+)  /? $ index.php? page = $ 1 & action = $ 2 [NC]
RewriteRule ^ ([a-z]+)  / ([a-z]+)  / ([0-9]+)  /? $ index.php? page = $ 1 & action = $ 2 & id = $ 3 [NC]


I have tried adding this on line 4;
RewriteCond% {REQUEST_URI}! ^ Inc / tools / [NC]

This gave RewriteCond: bad argument line error

I have tried adding this to line 2;

RewriteCond% {REQUEST_URI} ^ / inc / tools /(.*)$
RewriteRule ^. * $ - [L]

I have tried adding a .htaccess in / inc / tools with RewriteEngine OFF, it did not work.

I have tried the linked .htaccess tester in the top post, but its file (above) works IRL, it produces a & # 39; rule that is not met & # 39; for everything it contains!


The desired result is that I can allow direct access to http: // url / sdf19 / inc / tools > everything I've tried so far redirects me to the base http: // url / sdf19 /

How to list the total files for each subfolder in Google Drive?

In Google Drive I have a directory with more than 1000 subfolders. I want to list all the subfolders with the total number of files for each subfolder. This is the script I received so far, but it does not work because it only has a list of 0 for all subfolders

// replace your folder below with the root folder for which you want a listing
function listFolderContents () {
var foldername = & # 39; CC-Part2 & # 39 ;;
var folderlisting = & # 39; folder list & # 39; + folder name;

folders from var = DriveApp.getFoldersByName (folder name)
folder var = ();
var contents = folder.getFolders ();

var ss = SpreadsheetApp.create (list of folders);
sheet var = ss.getActiveSheet ();
sheet.appendRow ( ['name', 'size'] );

subfolder var;
name var
size var
row male
while (contents.hasNext ()) {
subfolder = ();
name = subfolder.getName ();
size = subfolder.getSize ();
sheet.appendRow ( [name, size] );

Can anyone help me fix this script?

Sharepoint Online REST API: list view threshold exceeded when querying items in subfolder with GetItems

I need to consult the elements in a certain folder and all its child elements in a document library with as few APIs as possible.
The ideal solution seemed to be getItems with Scope = & # 39; RecursiveAll & # 39; and a FolderServerRelativePath. However, the API below returns a SPQueryThrottledException for a specific document library in Sharepoint Online, and I can not find out the reason.

SUBMIT / _api / Web / Lists () / getItems? $ select = *, FileRef

"query": {
"odata.type": "SP.CamlQuery",
"ViewXml": "one"
"DatesInUtc": true,
"FolderServerRelativePath": {
"DecodedUrl": ""

Some observations:

  • The subfolder has 4 files and does not contain folders.
  • Obtaining items in any folder in the document library fails with the same error
  • The document library has about 6.5k elements (folders + files)
  • Scope = & # 39; Recursive & # 39; it also fails, but & # 39; Defect & # 39; Y & # 39; FilesOnly & # 39; works well
  • The same query worked for another document library with 100k files

What is the problem with the query? How can i fix it? If it is impossible to fix, are there other APIs that can recursively query the elements in a folder?

sharepoint online – How to get the file count within a subfolder – pnp-js?

I can get the count of files in a root folder using this

pnp.sp.web.lists.getByTitle ("Test") items.getAll (). then ((allItems) => {

// how many do we get?
console.log (allItems.length);


But how do I get the count of items within a subfolder?

For example

Suppose that the folder test contained the following subfolders:


The test contains 3 folders- (Test-1, Test-2 and Test-3)

Test-1 contains two folders (Test-1-1 and Test-1-2)

How do I get the Test-1-1 count using the above code?

apache 2.2 – How to show the main folder if the subfolder does not exist?

I'm working on an Ubuntu server running Apache and I have a problem showing the webpage I want.

For example, I want to have really show since I do not have a file or folder with my name.

The .htaccess file currently reads

RewriteEngine on
RewriteCond% {HTTP_HOST} ^ [NC]
RewriteRule ^ (. *) $ Http://$1 [L,R=301,NC]

What do I need to add to make this work?

seo – Website translation: new top-level domain vs current subfolder

Approximately 3 months ago, we translated our website into Spanish. Because our brand has a meaning in itself, we decided to translate the brand as well. The hope was that it would benefit our SEO.

For example (fictional):

We mark in both site maps the different versions of languages, and we place links on both websites that point to each other (in the footnote with an emerging language as seen in many websites).

We note that, even after 3 months, we have almost no traffic on the Spanish website. Our average .com ranking in Google is 6.6, while in .es it is 70. Clicks in search engines do not exist in .es, while in .com they are +1 million in the last 3 months.

Apart from the language, the website is the same. Meta tags have been translated too. There is no reason why English speakers have more interest in the content of our website.

So … we're starting to think that going for a new top-level domain was not that smart after all.

My question: would you recommend us go to or is it instead? Will we benefit from our good .com ranking? The main thing that we would like to achieve is that people looking for "soccer tactics" find our website, so it is not about Spaniards looking for "soccer tactics" and that a Spanish version is presented (which also It's good, of course). but the other will drive more traffic).

What are your thoughts?

Masks / rewrites the URL and displays the contents of the subfolder

I need to show this link: but to show the content of The user is dynamic and different every time.

.htaccess: how to redirect from a subfolder to a subfolder with htaccess

I have this folder structure:

/ sources
/Page 1
/ records
/page 2
/ records
/ page 3
/ records

The URLs that one would call would look like this:


Now everything I want to achieve with a .htaccess file located in / page 3 is that whoever visits is redirecting correctly to (or, I do not care if the name of the file is in the URL or not).

I tried

DirectoryIndex /content/page3/a/index.html

but in this case when I open all the relative references in the /a/index.html file is broken because the directory level in the URL is missing. Also, when calling jobs, Da 403 Prohibido.

I tried

Redirect 301 / content / page3 / content / page3 / a

but this obviously results in a spiral of endless redirection to Until the server stops trying.

So I thought I need something RedirectCond Y Redirection rule configuration. Unfortunately, I do not understand the syntax, and all the examples I observed do it at the higher level with more complex things like redirecting files and subfolders, sometimes outside of another domain, etc.

I tried this

RewriteEngine On

RewriteCond% {HTTP_HOST} ^ (www .)? Example  .com $
RewriteCond% {REQUEST_URI} ^ / content / page3 / $
RewriteRule ^ / content / page3 /? $ / Content / page3 / a [L]

because I thought this would replace "/ content / page3" with "/ content / page3 / a", but it did not help.

Now I went with the use of

DirectoryIndex /content/page3/a/index.html index.html

and replaced the relative references in the document by absolute. This works.

But first of all, I would still prefer that the references remain relative, so the document does not break in case page 3 the folder is renamed, and secondly I prefer to have the /a subdirectory in the URL for clarity of what is shown.

How I can get this?