Setting up a subdomain integration can be fairly straightforward. However, setting up a subfolder configuration instead can be a little trickier, as there are different web servers and they can be configured in numerous ways. This article aims to provide some troubleshooting steps in case the subfolder integration is not set up correctly.
Table of contents:
- What to look for
- What a default subfolder configuration code snippet looks like
- Most frequent issues:
- Query string parameters
- Other conflicting rulesets
- Include all configuration lines
What to look for:
To find out if the subfolder configuration is working, check the following:
- Is the newsroom homepage showing?
- Do the links to the individual articles work?
- Does the Search module work?
- Does the Download module work? It should trigger a direct download of the attached file.
- Does the downwards arrow (see image below) beneath the Headlines module work? It should load the remaining articles that are part of that headlines module.
If you cannot answer all above questions with 'yes', you may be dealing with a subfolder config issue.
What a default subfolder configuration code snippet looks like:
Apache:
SSLProxyEngine on
<Location "/subfolder-example">
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteRule ^.*/subfolder-example(.*)? https://client.presspage.com/$1?subfolder=1&clienthash=12e687a8eb2f0ee0ce7e30ff2b2bb1db&trail=%{REQUEST_URI} [QSA,L,P]
</IfModule>
</Location>
IIS:
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<system.webServer>
<rewrite>
<rules>
<rule name="Presspage Newsroom" stopProcessing="true">
<match url="^subfolder-example(.*)" />
<serverVariables>
<set name="HTTP_X_FORWARDED_HOST" value="www.example.com" />
</serverVariables>
<action type="Rewrite" url="http://client.presspage.com/{R:1}?subfolder=1&clienthash=12e687a8eb2f0ee0ce7e30ff2b2bb1db&trail=/{R:1}" logRewrittenUrl="true" />
</rule>
</rules>
</rewrite>
</system.webServer>
</configuration>
Nginx:
location /subfolder-example {
resolver 8.8.8.8;
rewrite ^/subfolder-example/(.*) /$1 break;
proxy_pass https://client.presspage.com$uri?subfolder=1&clienthash=12e687a8eb2f0ee0ce7e30ff2b2bb1db&trail=$uri&$args;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-Host www.example.com;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_pass_request_headers on;
}
Please note that the clienthash is different for every account and should not be copied to your configuration from this Knowledge Base page.
If you're using a CDN, please make sure that it passes the IP address of the client to the origin, rather than the IP address of the CDN itself.
Most frequent issues:
Query string parameters
One thing that we see quite often is that requests with query string parameters in them will not actually hit the Presspage servers, which causes the problems with the Search, Download and Headline Modules.
If you have a Web Application Firewall (WAF) or a CDN such as Akamai, Cloudflare or AWS Cloudfront in place, make sure that these requests do not get filtered out. Query strings should be forwarded to the origin.
Make sure that caching on your end is not interfering with this.
Other conflicting rulesets
Another thing to check is to make sure that you don't have any other configuration rules in direct conflict with the snippet supplied by us. Have a look if an exception can be made, or if the snippet can be moved to the beginning of the file to make sure it gets executed first.
Also make sure that there is not another application with rulesets of its own conflicting with the snippet.
If you're using Sitecore, make sure to add the newsroom subfolder to the "Ignore URL prefix list".
Include all configuration lines
Finally, make sure that all configuration lines have been included, and that the regex in the rule is correct.
Comments
0 comments
Article is closed for comments.