mod-rewrite不工作网络解决方案的服务器上 [英] Mod-rewrite not working on Network Solutions server

查看:113
本文介绍了mod-rewrite不工作网络解决方案的服务器上的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个网站,要求mod-rewrite运作良好,但它似乎没有功能上的共享我们正在运行在服务器上的网络解决方案。网络解决方案的承诺它的安装,但没有额外的付款将不提供任何进一步的支持。

I have a website that requires mod-rewrite to function well, but it seems to not be functional on the Network Solutions shared server we're running on. Network Solutions promises it's installed but won't provide any further support without additional payment.

我把一个简单的测试,在其中包含两个文件的以下文件夹。第一,的.htaccess包含以下文本:

I placed a simple test at the following folder which contains two files. The first, ".htaccess" contains the following text:

RewriteEngine On
RewriteRule ^link([^/]*).html$ rewrite.php?link=$1 [L]

二是PHP脚本测试它,可在这里: http://www.oceanhousefloridakeys.com/testmr/rewrite.php

The second is the PHP script which tests it, available here: http://www.oceanhousefloridakeys.com/testmr/rewrite.php

我所看到的是,mod-rewrite安装(没有错误消息显示),但重写规则是行不通的。任何人都可以看到该脚本为什么不工作...有什么我可以做的就是它运行的,或者是网络解决方案没有告诉全部真相?

All I see is that mod-rewrite is installed (no error messages showing) but the rewriteRule is not working. Can anybody see why this script isn't working... is there anything I can do to get it running, or is Network Solutions not telling the whole truth?

推荐答案

它看起来像你的脚本所在的子目录中。在这种情况下,它设置 的RewriteBase的最佳解决方案 以正确的路径(在任何重写规则):

It looks like your script resides inside a sub-directory. In that case it's the best solution to set the RewriteBase to the correct path (before any RewriteRule):

RewriteEngine On
RewriteBase /testmr/
RewriteRule ^link([^/]*).html$ rewrite.php?link=$1 [L]

这篇关于mod-rewrite不工作网络解决方案的服务器上的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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