mod_rewrite URL info required

前端 未结 2 1338
日久生厌
日久生厌 2020-12-12 05:38

I am new to this mod_rewrite. I have been successfully able to rewrite the URL something like this: http://mydomain.com/products/12 to this: http://mydoma

2条回答
  •  不思量自难忘°
    2020-12-12 06:08

    You need to know that relative URIs (thus absolute and relative URI paths too) are resolved from a base URI that is – if not explicitly declared – the URI of the current document.

    So if you reference external resources from /products/12 with the relative URI foo/bar, it’s resolved to /products/foo/bar.

    To fix this, use absolute URI paths (beginning with /) or absolute URIs (beginning with the protocol) or set explicitly a base URI other than the current (see BASE HTML element). But note that changing the base URI has some side effects as it affects every relative URI.

提交回复
热议问题