【发布时间】:2023-03-14 13:28:01
【问题描述】:
我正在使用 Reactjs 客户端,并且我有两个索引 index.html 和 indexAR.html 我正在为每种语言的 SEO 做一个索引。
网址示例:example.com/ar/{pages}
网址示例:example.com/en/{pages}
所以我需要告诉 HTTP 服务器如果 find ar in URL 返回 indexAR.html 如果还有其他返回 index.html
#.htaccess
Options -Indexes
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ /index.html?path=$1 [NC,L,QSA]
【问题讨论】:
标签: reactjs apache .htaccess http mod-rewrite