对于想了解Apachemod_rewrite内部到不同的端口的读者,本文将提供新的信息,并且为您提供关于apachemod_rewrite、Apachemod_rewriteRewriteRule禁止
对于想了解Apache mod_rewrite内部到不同的端口的读者,本文将提供新的信息,并且为您提供关于apache mod_rewrite、Apache mod_rewrite RewriteRule禁止字、Apache mod_rewrite和多个域、Apache mod_rewrite将双斜杠转换为一个斜杠的有价值信息。
本文目录一览:- Apache mod_rewrite内部到不同的端口
- apache mod_rewrite
- Apache mod_rewrite RewriteRule禁止字
- Apache mod_rewrite和多个域
- Apache mod_rewrite将双斜杠转换为一个斜杠
Apache mod_rewrite内部到不同的端口
是否有可能在内部redirect(所以URL不会在地址栏中更改)与mod_rewrite到同一主机上的不同端口? 例如
http://host.com:8080 -> http://host.com:9999/myapplication/?param=val
Apache重写规则引导斜线
如何使用Apache / mod_rewrite基于Accept-Language进行redirect
.htaccess将下划线重写为超链接,剥离扩展和删除尾部下划线
redirect到另一个域,但保持该url
.htaccess重写程序在mac上无法正常工作
1,启用mod_proxy
Loadmodulee proxy_module modules/mod_proxy.so Loadmodulee proxy_http_module modules/mod_proxy_http.so
2,你应该为vhost配置apache:
<VirtualHost *:8080> .... ProxyPass / http://host.com:9999/myapplication/?param=val ProxyPassReverse / http://host.com:9999/myapplication/?param=val </VirtualHost>
3,安装端口9999 VHost
更多信息:
http://httpd.apache.org/docs/2.2/mod/mod_proxy.html
http://www.apachetutor.org/admin/reverseproxies
用[P]详细说明mod_proxy解决方案,代理标志:
启用模块mod_proxy和mod_proxy_http:
a2enmod proxy proxy_http
如果没有启用这两个,您稍后将获得一个300 Forbidden状态,并且在日志中显示错误消息“AH00669:尝试在没有启用代理的情况下从mod_rewrite发出远程请求”。
将以下内容放入转发主机的Apache2 vhost配置部分:
<VirtualHost *:8080> … RewriteEngine on RewriteCond %{REQUEST_URI} !^$ RewriteCond %{REQUEST_URI} !^/ RewriteRule .* - [R=400,L] RewriteRule (.*) http://host.com:9999/myapplication/$1?param=val [P,L] … </VirtualHost>
这包括Steve Webster用来防止恶意网址制作的技术。 但不知道如何处理在这种情况下附加GET参数。
重新启动Apache2:
sudo service apache2 restart
apache mod_rewrite
参考: Apache模块 mod_rewrite
一、将域名做一个泛解析*.xxxx.com 解析到你的空间IP,独立IP虚拟主机支持泛解析,不需要绑定域名就可以访问网站。
二、建立bbs 、home 目录,将CMS上传到根目录,将论坛上传到bbs目录,将ucenterHome上传到home目录。
三、打开记事本将以下代码复制进去,保存为.htaccess文件,上传到根目录下。
.htaccess文件内容如下:(以xxx.cn域名为例)
RewriteEngine on
DirectoryIndex index.php index.html index.htm
#让www.xxx.cn 访问根目录CMS
RewriteCond %{HTTP_HOST} ^www.xxx.cn$
RewriteCond %{REQUEST_URI} !^/
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ /$1
RewriteCond %{HTTP_HOST} ^www.xxx.cn$
RewriteRule ^(/)?$ /index.php [L]
#让home.xrnic.cn 访问home目录UcenterHome
RewriteCond %{HTTP_HOST} ^home.xxx.cn$
RewriteCond %{REQUEST_URI} !^/home/
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ /home/$1
RewriteCond %{HTTP_HOST} ^home.xxx.cn$
RewriteRule ^(/)?$ home/index.php [L]
#让bbs.xrnic.cn 访问bbs目录论坛
RewriteCond %{HTTP_HOST} ^bbs.xxx.cn$
RewriteCond %{REQUEST_URI} !^/wap/
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ /bbs/$1
RewriteCond %{HTTP_HOST} ^bbs.xxx.cn$
RewriteRule ^(/)?$ bbs/index.php [L]
按照以上方法可以一个空间建立N个网站
Apache mod_rewrite RewriteRule禁止字
如何解决Apache mod_rewrite RewriteRule禁止字?
我刚刚找到了RewriteRule禁止的单词: filmi (斯洛文尼亚语为 movies )。 更加具体: 如果我设置了
RewriteRule ^filmi/novFilm/?$ index.PHP?stran=novFilm
,然后访问 mydomain.example / filmi / novFilm,我得到未找到响应。我尝试过的其他代替 filmi 的作品。
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)
Apache mod_rewrite和多个域
我试图使用mod_rewrite将多个域映射到一台主机上的不同servlet。 例:
www.dom1.com – > 192.168.1.n / dom1
www.dom2.com – > 192.168.1.n / dom2 …
我正在使用mod_rewrite和mod_proxy和VirtualHost指令,但似乎通过ProxyPassReverse的反向映射不能正常工作。
Android Studio 1.5.1在APK meta-inf / NOTICE.txt中复制的重复文件commons-codec-1.9.jar …?
在网站根目录和子目录中使用.htaccess中的mod_rewrite
设置上传文件夹777权限是否安全?
我得到403错误使用乘客在阿帕奇铁路
尝试在Ubuntu 15.04上的Tomcat8上部署WAR时发生错误
ProxyPassReverse /subdomain.domain.com http://192.168.1.n/subdomain
不起作用。 我已经开始重写日志了
RewriteLog /var/log/rewrite.log
从日志我会说改写的作品,这个问题似乎与反向映射。 但是我看不到任何反转映射条目。 看来反向映射不会被logging或需要一个不同的命令来激活。 (Apache和servlet容器在不同的机器上,但这不应该考虑我?
为什么不是Flask给我一个交互式debugging器?
XAMPP在Windows 7启动时自动启动
如果django项目在子文件夹和子域中,如何编写.htaccess?
我无处不在地改变Apache的DocumentRoot无济于事
PHP文件自动改名为PHP.SUSPECTed
毕竟我找到了适合我的解决方案。 这是我的配置摘录,显示域1的一个虚拟主机
<VirtualHost *> serverName www.dom1.com serverAlias dom1.com RewriteEngine On # logs might be omitted RewriteLog /var/log/dom1_rewrite.log RewriteLogLevel 2 CustomLog /var/log/dom1_custom.log common ErrorLog /var/log/dom1_error.log # rewrite to internal ip RewriteRule ^/(.*) http://192.168.1.105/dom1/$1 [L,P,E=proxy_ok:1] # Preserve the host-part in the forwarded url ProxyPreserveHost On # Substitute responses with the original ProxyPassReverse / http://192.168.1.105/dom1/ ProxyPassReverse / http://192.168.1.105/dom1 ProxyPassReverse / http://dom1.com/dom1/ ProxyPassReverse / http://dom1.com/dom1 </VirtualHost>
我的第一个配置有什么问题 – 我必须保留主机,然后添加所有必要的ProxyPassReverse规则来替代响应。
这是我的mod_proxy配置:
<Ifmodulee mod_proxy.c> #turning ProxyRequests on and allowing proxying from all may allow #spammers to use your proxy to send email. ProxyRequests Off <Proxy *> AddDefaultCharset off Order deny,allow Deny from all # Proxies just in case Proxy_ok is set Allow from env=proxy_ok </Proxy> # Not sure whether we need this ... # Enable/disable the handling of HTTP/1.1 "Via:" headers. # ("Full" adds the server version; "Block" removes all outgoing Via: headers) # Set to one of: Off | On | Full | Block ProxyVia On </Ifmodulee>
可能有更清洁的解决方案,但是 – 如果按照原样运作。
总结
以上是小编为你收集整理的Apache mod_rewrite和多个域全部内容。
如果觉得小编网站内容还不错,欢迎将小编网站推荐给好友。
Apache mod_rewrite将双斜杠转换为一个斜杠
我有这样的url:
http://example.com/img.PHP?url=http://example2.com/path/to/image/name.jpg
所以我创build了一个规则,通过这个问题Apache mod_rewrite复杂的URL正则expression式的帮助
RewriteRule ^img.PHP/(.+?(?:.jpg|.png))$ img.PHP?url=$1
但是当我在htaccess文件中使用这个规则,并使用这样的URL:
http://example.com/img.PHP/http://example2.com/path/to/image/name.jpg
在http:在我的参数转换为一个斜杠后的结果双斜杠! 所以我的第一个参数在PHP变成:
Linux CLI更改价格(awk或sed?)
在grep中转义斜线“”
如何使用AWK从string中删除所有小写字符?
正则expression式模式来编辑/ etc / sudoers文件
简单.htaccessredirect:如何redirect参数?
http:/example2.com/path/to/image/name.jpg
你能帮我吗?
Nginx位置代字号
根据第二个文本文件从文本文件中删除重复项
Nginx – 找不到位置重写
Nginx获取url的子域名并且指定文档根目录
用bash或命令行使用正则expression式从文本文件中提取电子邮件地址
Apache将多个/进入单个/在RewriteRule 。 改用RewriteCond :
RewriteCond %{REQUEST_URI} ^/img.PHP/(.+?.(?:jpe?g|png))$ [NC] RewriteRule ^ img.PHP?url=%1 [L,QSA]
总结
以上是小编为你收集整理的Apache mod_rewrite将双斜杠转换为一个斜杠全部内容。
如果觉得小编网站内容还不错,欢迎将小编网站推荐给好友。
关于Apache mod_rewrite内部到不同的端口的问题我们已经讲解完毕,感谢您的阅读,如果还想了解更多关于apache mod_rewrite、Apache mod_rewrite RewriteRule禁止字、Apache mod_rewrite和多个域、Apache mod_rewrite将双斜杠转换为一个斜杠等相关内容,可以在本站寻找。
本文标签: