.htaccess file all others whoa re not some browser

后端 未结 1 1398
南方客
南方客 2021-01-24 05:39

I have this code:

RewriteCond %{HTTP_USER_AGENT} (navigator) [NC]
RewriteRule ^newfolder/(.*)$ /index.html [L,NC]

I em intresting in first line

1条回答
  •  执笔经年
    2021-01-24 06:23

    You can use negation in RewriteCond:

    RewriteCond %{HTTP_USER_AGENT} !(opera|navigator|safari) 
    RewriteRule ^newfolder/(.*)$ /index.html [L,NC]
    

    PS; Take note of RewriteCond %{HTTP_USER_AGENT} !navigator which means all user agents except navigator.

    0 讨论(0)
提交回复
热议问题