的.htaccess改写到另一个端口 [英] .htaccess rewrite to another port

查看:650
本文介绍了的.htaccess改写到另一个端口的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个Joomla安装在我的/ home /的Joomla目录。 我安装Apache和Lighttpd的 我已经配置Lighttpd的代理只静态文件,lighttpd的侦听端口81。 现在,我想是

I have a joomla setup in my /home/joomla directory. I installed both Apache and Lighttpd i have configured Lighttpd to proxy only static files, and lighttpd is listening on port 81. Now what i want is

每当请求静态文件是由,而不是去

whenever request for static files are made, instead of going to

www.domain.com/whatever/bg.jpg

www.domain.com/whatever/bg.jpg

它应该重定向到

domain.com:81/whatever/bg.jpg

domain.com:81/whatever/bg.jpg

使用的.htaccess

using .htaccess

还注意到,www.domain.com更改为domain.com

also notice that www.domain.com changed to domain.com

请请我需要一个快速的帮助吧:)

please please i need a quick help for it :)

推荐答案

好吧,我找到了方向:)

Alright i found out the way :)

RewriteCond %{HTTP_HOST} ^www\.(.*) [NC]
RewriteRule \.(jpg|jpeg|png|gif|css)$ http://domain.com:81/$1 [P,QSA,L]

学到了很多关于htaccess的文件在一天:)

Learned a lot about htaccess files in one day :)

这篇关于的.htaccess改写到另一个端口的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆