开发者

Rewrite url for missing resource

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜