Apache
Cloudflare
Apache is an open-source web server software that facilitates the delivery of web pages over the Internet. It is highly configurable and widely used in hosting websites due to its stability and flexibility.

Integrating PERENDER with Apache.

Step 1.

Enable the following modules in the httpd.conf file:

1. headers_module
2. proxy_module
3. proxy_http_module
4. ssl_module
5. rewrite_module
To do this, uncomment the LoadModule line for each of the above modules in the httpd.conf file.

Then, add the following code in the httpd.conf file to allow proxy through https.

<IfModule mod_ssl.c>
         SSLProxyEngine On
</IfModule>

Step 2.

1. Then, create a file named .htaccess in the root of your application.
Notes:
If your application already has the .htaccess file, include the following code.
If your .htaccess file already contains rewrite rules, include the PERENDER rule at the beginning of them and remove [END] from the provided code to allow the evaluation of your subsequent rewrite rules.

2. Within the provided code, replace [PERENDER_TOKEN] with your token from the PERENDER dashboard.

Repository on GitHub at the following address https://github.com/perender/perender-apache/blob/main/.htaccess
<IfModule mod_headers.c>
 RequestHeader set Authorization "Bearer [PERENDER_TOKEN]"
</IfModule>
<IfModule mod_rewrite.c>
 RewriteEngine On
 <IfModule mod_proxy_http.c>
 RewriteCond %{HTTP_USER_AGENT} googlebot|bingbot|msnbot|adidxbot|yahoo!\ slurp|qwantify|petalbot|bytespider|sogou\ web\ spider|sogou\ inst\ spider|exabot|seznambot|naverbot|yetibot|yandexbot|yandeximages|yandexaccessibilitybot|perplexity|perplexitybot|oai-searchbot|chatgpt|gptbot|claudebot|cohere-ai|youbot|facebookexternalhit|twitterbot|linkedinbot|embedly|quora\ link\ preview|showyoubot|outbrain|pinterest\/0\.|pinterestbot|slackbot|slackbot-linkexpanding|vkShare|W3C_Validator|w3c-checklink|whatsapp|redditbot|applebot|flipboard|flipboardproxy|flipboardrss|tumblr|bitlybot|skypeuripreview|nuzzel|discordbot|snapchat|viber|mattermost|telegrambot|chrome-lighthouse|lighthouse|google\ page\ speed|siteimprove|serpstatbot|uptimerobot|uptimebot|pingdom|gtmetrix|majestic-12|mj12bot|semrushbot|ahrefsbot|dotbot|screaming\ frog\ seo\ spider|seokicks|rogerbot|360spider|soso|baiduspider-render|bitrix\ link\ preview|xing-contenttabreceiver|integration-test|google-inspectiontool|amazonbot|adsbot-google|googlebot-image|googlebot-news|googlebot-video|facebot|archive.org_bot|paperlibot|dataprovider.com|grapeshotcrawler|zoominfobot|feedly|feedlybot|newsblur|inoreader|ccbot [NC,OR]
 RewriteCond %{QUERY_STRING} _escaped_fragment_
 RewriteCond %{REQUEST_URI} ^(?!.*?(\.js|\.json|\.css|\.xml|\.less|\.png|\.jpg|\.jpeg|\.gif|\.pdf|\.doc|\.txt|\.ico|\.rss|\.zip|\.mp3|\.rar|\.exe|\.wmv|\.avi|\.ppt|\.mpg|\.mpeg|\.tif|\.wav|\.mov|\.psd|\.ai|\.xls|\.mp4|\.m4a|\.swf|\.dat|\.dmg|\.iso|\.flv|\.m4v|\.torrent|\.ttf|\.woff|\.svg|\.webmanifest|\.webp))
 RewriteRule ^(index\.html|index\.php)?(.*) "https://api.perender.com/render?url=%{REQUEST_SCHEME}://%{HTTP_HOST}$2&botAgent=apache" [P,END,NE] 
 </IfModule> 
</IfModule>


Powered by AstrolUi
An unhandled error has occurred. Reload 🗙