Skip to content

Commit 569ec03

Browse files
committed
update htaccess
1 parent e7b405e commit 569ec03

1 file changed

Lines changed: 10 additions & 9 deletions

File tree

webui/public/.htaccess

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,18 @@
3232
# Redirect anything under /docs/guides/smtp to /docs/guides/mail/
3333
RewriteRule ^docs/guides/smtp/?(.*)$ /docs/guides/mail/$1 [R=301,L]
3434

35+
# rewrite for bots
36+
RewriteCond %{HTTP_USER_AGENT} googlebot|bingbot|Seobility|yandex|baiduspider|facebookexternalhit|twitterbot|rogerbot|linkedinbot|embedly|quora\ link\ preview|showyoubot|outbrain|pinterest\/0\.|pinterestbot|slackbot|vkShare|W3C_Validator|whatsapp|redditbot|applebot|flipboard|tumblr|bitlybot|skypeuripreview|nuzzel|discordbot|google\ page\ speed|qwantify|bitrix\ link\ preview|xing-contenttabreceiver|google-inspectiontool|chrome-lighthouse|telegrambot|amazonbot [NC]
37+
RewriteCond %{REQUEST_URI} !\.(html|css|js|less|jpg|png|gif|svg|woff2|xml)$
38+
RewriteCond %{REQUEST_FILENAME} !-f
39+
RewriteCond %{REQUEST_FILENAME} !-d
40+
# Only rewrite for bots IF the .html file exists
41+
RewriteCond %{REQUEST_FILENAME}.html -f
42+
RewriteRule ^(.+)$ $1.html [L]
43+
3544
# rewrite for bots if tailing /
3645
RewriteCond %{HTTP_USER_AGENT} googlebot|bingbot|Seobility|yandex|baiduspider|facebookexternalhit|twitterbot|rogerbot|linkedinbot|embedly|quora\ link\ preview|showyoubot|outbrain|pinterest\/0\.|pinterestbot|slackbot|vkShare|W3C_Validator|whatsapp|redditbot|applebot|flipboard|tumblr|bitlybot|skypeuripreview|nuzzel|discordbot|google\ page\ speed|qwantify|bitrix\ link\ preview|xing-contenttabreceiver|google-inspectiontool|chrome-lighthouse|telegrambot|amazonbot [NC]
37-
RewriteCond %{REQUEST_FILENAME} !^$
46+
RewriteCond %{REQUEST_FILENAME} -d
3847
# url ends with a slash
3948
RewriteCond %{REQUEST_FILENAME} /$
4049
# Rewrite /about/ → /about/index.html
@@ -45,14 +54,6 @@
4554
RewriteCond %{REQUEST_FILENAME} -d
4655
RewriteRule ^(.+[^/])$ $1/index.html [L]
4756

48-
# rewrite for bots
49-
RewriteCond %{HTTP_USER_AGENT} googlebot|bingbot|Seobility|yandex|baiduspider|facebookexternalhit|twitterbot|rogerbot|linkedinbot|embedly|quora\ link\ preview|showyoubot|outbrain|pinterest\/0\.|pinterestbot|slackbot|vkShare|W3C_Validator|whatsapp|redditbot|applebot|flipboard|tumblr|bitlybot|skypeuripreview|nuzzel|discordbot|google\ page\ speed|qwantify|bitrix\ link\ preview|xing-contenttabreceiver|google-inspectiontool|chrome-lighthouse|telegrambot|amazonbot [NC]
50-
RewriteCond %{REQUEST_URI} !\.(html|css|js|less|jpg|png|gif|svg|woff2|xml)$
51-
RewriteCond %{REQUEST_FILENAME} !^$
52-
# Only rewrite for bots IF the .html file exists
53-
RewriteCond %{REQUEST_FILENAME}.html -f
54-
RewriteRule ^(.+)$ $1.html [L]
55-
5657
# rewrite for bots for root page
5758
RewriteCond %{HTTP_USER_AGENT} googlebot|bingbot|Seobility|yandex|baiduspider|facebookexternalhit|twitterbot|rogerbot|linkedinbot|embedly|quora\ link\ preview|showyoubot|outbrain|pinterest\/0\.|pinterestbot|slackbot|vkShare|W3C_Validator|whatsapp|redditbot|applebot|flipboard|tumblr|bitlybot|skypeuripreview|nuzzel|discordbot|google\ page\ speed|qwantify|bitrix\ link\ preview|xing-contenttabreceiver|google-inspectiontool|chrome-lighthouse|telegrambot|amazonbot [NC]
5859
RewriteCond %{DOCUMENT_ROOT}/home.html -f

0 commit comments

Comments
 (0)