htaccess 有两个语言环境索引
htaccess with two indexes for locales
我正在使用 Reactjs 客户端,我有两个索引 index.html 和 indexAR.html 我我正在为每种语言的 SEO 做一个索引。
URL示例:示例。com/ar/{pages}
URL示例:示例。com/en/{pages}
所以如果在URLreturnsindexAR.html[=24中找到ar,我需要告诉HTTP服务器=] 如果还有什么 returns index.html
#.htaccess
Options -Indexes
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ /index.html?path= [NC,L,QSA]
按照以下方式创建您的 htaccess 规则文件。确保你的 htaccess 规则文件与 ar
、en
文件夹(不在它们里面,除了它们)一起存在。
确保在测试您的 URL 之前清除您的浏览器缓存。
RewriteEngine ON
Options -Indexes
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^ar indexAR.html [NC,L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)/?$ index.html?path= [NC,L,QSA]
我正在使用 Reactjs 客户端,我有两个索引 index.html 和 indexAR.html 我我正在为每种语言的 SEO 做一个索引。
URL示例:示例。com/ar/{pages}
URL示例:示例。com/en/{pages}
所以如果在URLreturnsindexAR.html[=24中找到ar,我需要告诉HTTP服务器=] 如果还有什么 returns index.html
#.htaccess
Options -Indexes
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ /index.html?path= [NC,L,QSA]
按照以下方式创建您的 htaccess 规则文件。确保你的 htaccess 规则文件与 ar
、en
文件夹(不在它们里面,除了它们)一起存在。
确保在测试您的 URL 之前清除您的浏览器缓存。
RewriteEngine ON
Options -Indexes
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^ar indexAR.html [NC,L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)/?$ index.html?path= [NC,L,QSA]