开发者

Rewrite url for missing resource

开发者 https://www.devze.com 2022-12-31 12:22 出处:网络
For each web request (file or directory) that doesn\'t start with /en-US/, I want to serve up the original resource if it exists, otherwise serve up the /en-US/ version.

For each web request (file or directory) that doesn't start with /en-US/, I want to serve up the original resource if it exists, otherwise serve up the /en-US/ version.

How开发者_C百科 would I do this using rewrite rules in a .htaccess file?


Try something like this:

RewriteCond $0 !^en-US/
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule .+ en-US/$0 [L]
0

精彩评论

暂无评论...
验证码 换一张
取 消