redirect non-index page requests to hash links with .htaccess

后端 未结 1 1659
野性不改
野性不改 2021-01-17 02:05

i\'m weak in regular expressions, i need to redirect any FileName.htm or FileName.html page request to ./#FileName, only i

相关标签:
1条回答
  • 2021-01-17 02:39

    Try this rule:

    RewriteCond $1 !=index [NC]
    RewriteCond %{HTTP_REFERER} !^$
    RewriteCond %{HTTP_REFERER} !^https?://(www\.)?example\.com/ [NC]
    RewriteRule ^([a-zA-Z0-9\-_]+)\.html?$ /#$1 [NE,R]
    
    0 讨论(0)
提交回复
热议问题