开发者

.htaccess solution for localhost

I am developing local websites and keep having problems with wordpress sites when they use relative links such as:

<a href="/wp-content/themes/mytheme/myfile.php">

This resolves to my localhost document root (htdocs) instead of the root of the job (htdocs/myjob).

Is it possible to use an .htaccess file in the root of the job (htdocs/myjob) folder to "fix" this behaviour? Or is it possible to put this htaccess file in htdocs, check the HTTP_REFERER, and send the browser to the corre开发者_开发技巧ct site root?

Can you show me an example of the rewrite rule needed?

Any other suggestions would be welcome too.


In fact you mean absolute links. Relative links are what you want.

You should be able to configure the root directory in your Wordpress setup: this would be the correct approach.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜