Skip to content

Commit 920e97e

Browse files
committed
fix soft 404 for bots
1 parent 0200762 commit 920e97e

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

webui/public/.htaccess

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,11 +44,13 @@
4444
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]
4545
RewriteCond %{REQUEST_URI} !\.(html|css|js|less|jpg|png|gif|svg|woff2|xml)$
4646
RewriteCond %{REQUEST_FILENAME} !^$
47-
RewriteCond %{REQUEST_FILENAME} !-f
47+
# Only rewrite for bots IF the .html file exists
48+
RewriteCond %{REQUEST_FILENAME}.html -f
4849
RewriteRule ^(.+)$ $1.html [L]
4950

50-
# rewrite for bots
51+
# rewrite for bots for root page
5152
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]
53+
RewriteCond %{DOCUMENT_ROOT}/home.html -f
5254
RewriteRule ^$ home.html [L]
5355

5456
# rewrite for spa vuejs

0 commit comments

Comments
 (0)