Mod-rewrite not working on Network Solutions server

走远了吗. 提交于 2019-12-24 17:53:12

问题


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.

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]

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

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?


回答1:


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]


来源:https://stackoverflow.com/questions/10934952/mod-rewrite-not-working-on-network-solutions-server

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!