开发者

SLASH "/" in front of relative urls in RewriteRule: Correct Syntax?

开发者_JAVA百科

Given:

RewriteCond %{HTTP_HOST} ^website.com$  
RewriteRule ^$ /de/home [L]

Question: examine the slash in front of de:

/de/home

de/home

What is the difference here and which is more advisable to use?


There is probably no difference in this context, because you are likely to be in the root directory.

Were you not in the root directory, but in a sub-folder like, say,

example.com/beta

, de/home could point to

example.com/beta/de/home

The starting slash makes sure the URL starts at the root directory, regardless where you are.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜