晕,这个不需要重吧,用域名转向不可以吗?
如果你非要重写的话,在.htaccess文件中:
RewriteEngine onRewriteCond %{HTTP_HOST} ^xxx.php.com$
RewriteRule ^(.*)$ /xxx/$1 [L]
如果你非要重写的话,在.htaccess文件中:
RewriteEngine onRewriteCond %{HTTP_HOST} ^xxx.php.com$
RewriteRule ^(.*)$ /xxx/$1 [L]
解决方案 »
- 新手半夜求解:Unknown column 'qq' in 'field list'怎么解决
- PHP网站如何才能限制IP?
- 彻底理解了session机制的朋友:每隔多少时间谁来清除session的呢?
- 字符串替换问题,将 字符 " 替换为 \" 怎么写呢?
- 从来就没见过这么垃圾的搜索引擎!!!
- 急问:关于读取数据库中长内容时被截断的问题
- 如何用表单上传文件(在线等)
- 各位php的大虾,请问php可以实现多线程技术吗??
- 我是菜鸟 我在学习中~~~~~~~~~~~看不懂的TS
- 我想学PHP,下了一个PHPtriad,它说一次性安装后就可以用了。怎么用哟?
- 谁能帮我把.net改为PHP
- 到这里问个滚动条的问题,呵呵
我找到一个可行的,但有点小问题,就是地址栏也跟着变,比如我访问xxx.abc.com,真实的地址是www.abc.com/xxx,下面的可以转向真实地址,可是地址栏也跟着变成www.abc.com/xxx了,我不想变地址栏,重写不是就不变吗?谁能帮我解决下?
RewriteEngine on
RewriteCond %{HTTP_HOST} ^[^{www}]+\.abc\.com$
RewriteRule ^(.+) %{HTTP_HOST}$1 [C]
RewriteRule ^([^{www}]+)\.abc\.com(.*) http://www.abc.com/$1$2
RewriteRule ^([0-9]*)\.html /test.php/$1 [T]
后面可以加任意的路径。
放在
http://www.php.com/
对应的目录下面黄肌瘦,不要放在
xxx里面
也就是说,不放.htaccess的时候,这两个域名访问到的内容一样。
我放在根目录下啊。
xxx这个就没有呀,是要传这个参数啊。
RewriteCond %{HTTP_HOST} ^[^{www}]+\.abc\.com$
RewriteRule ^(.+) %{HTTP_HOST}$1 [C]
RewriteRule ^([^{www}]+)\.abc\.com(.*) /$1$2
The server encountered an internal error or misconfiguration and was unable to complete your request.
Please contact the server administrator, [no address given] and inform them of the time the error occurred, and anything you might have done that may have caused the error.More information about this error may be available in the server error log.--------------------------------------------------------------------------------Apache/1.3.33 Server at 192.168.0.7 Port 80
aaa
bbb
放一些可以访问的东西
这样才可以测试
aaa.yourdomain.com
bbb.yourdomain.com
是不是对的
http://www.abc.com/$1$2改成^/$1$2$
如果象你说的一样,以前转向可以,那现在也应该可以
好像二楼的就正确着了,我再改改,谢谢你,一会结贴,你再帮我看下http://topic.csdn.net/u/20071114/10/32d836ba-5c19-4ada-9d14-9fb0f8542a6d.html
php也才开始学,我试了一下,是会出500错误,搞不懂了,你自己多研究:)