“RewriteBase:参数不是有效的URL”错误

时间:2010-03-30 19:51:50

标签: php .htaccess cpanel

我正在尝试配置我网站的.htaccesshttp://213.175.210.49/~incisozl/是根目录的临时网址(~/public_html/)。

当我尝试在.htaccess重写网址时,我得到了一个

  

/home/incisozl/public_html/.htaccess: RewriteBase: argument is not a valid URL, referer: ht tp://213.175.210.49/~incisozl/inci-sozluk/somestring

错误。

我的重写规则是;

<IfModule mod_rewrite.c>
RewriteEngine On

RewriteBase /

RewriteRule ^/?$ /index.php [L]

RewriteRule ^inci-sozluk/([^\.\?/]+)/([0-9]+)/?$ /seo.php?process=word&q=$1&sayfa=$2 [L]

RewriteRule ^inci-sozluk/([^\.\?/]+)?$ /seo.php?process=word&q=$1 [L]

RewriteRule ^inci-sozluk/([^\.\?/]+)/([0-9]+)/([0-9]+)/?$ /seo.php?process=word&q=$1&sayfa=$2&gid=$3 [L]

RewriteRule ^inci-sozluktest/([^\.\?/]+)/([0-9]+)/([0-9]+)/?$ /seo.php?process=wordtest&q=$1&sayfa=$2&gid=$3 [L]

RewriteRule ^inci-sozluk-bugun/([^\.\?/]+)/([0-9]+)/?$ /seo.php?process=wordbg&q=$1&sayfa=$2 [L]

RewriteRule ^inci-sozluk-bugun/([^\.\?/]+)/([0-9]+)/([0-9]+)/?$ /seo.php?process=wordbg&q=$1&sayfa=$2&gid=$3 [L]

RewriteRule ^inci-sozluk-dun/([^\.\?/]+)/([0-9]+)/([0-9]+)/?$ /seo.php?process=worddn&q=$1&sayfa=$2&gid=$3 [L]

RewriteRule ^inci-sozluk-dun/([^\.\?/]+)/([0-9]+)/?$ /seo.php?process=worddn&q=$1&sayfa=$2 [L]
RewriteRule ^inci-sozluk-ters/([^\.\?/]+)/([0-9]+)/?$ /seo.php?process=wordts&q=$1&sayfa=$2 [L]

RewriteRule ^inci-sozluk-ters/([^\.\?/]+)/([0-9]+)/([0-9]+)/?$ /seo.php?process=wordts&q=$1&sayfa=$2&gid=$3 [L]

RewriteRule ^inci-sozluk-cvpters/([^\.\?/]+)/([0-9]+)/?$ /seo.php?process=cvpwordts&q=$1&sayfa=$2 [L]

RewriteRule ^inci-sozluk-cvpters/([^\.\?/]+)/([0-9]+)/([0-9]+)/?$ /seo.php?process=cvpwordts&q=$1&sayfa=$2&gid=$3 [L]

RewriteRule ^inci-sozluk-ileti/([0-9]+)/?$ /seo.php?process=eid&eid=$1 [L]

RewriteRule ^inci-sozluk-ileticvp/([0-9]+)/?$ /seo.php?process=cvpeid&eid=$1 [L]
</IfModule>

顺便说一句。当我使用www.incisozluk.org指向域

时,它工作正常

2 个答案:

答案 0 :(得分:1)

这很奇怪,因为生成此错误消息的唯一地方是 modules / mappers / mod_rewrite.c中的cmd_rewritebase(),代码为

if (a1[0] != '/') {
  return "RewriteBase: argument is not a valid URL";
}

它测试RewriteBase的新值的第一个字符是否为/。
根据您发布的代码就是这种情况。是否会有另一个具有无效值的.htaccess文件?

答案 1 :(得分:0)

这是古老的,但我刚刚遇到这个问题,对我而言,问题是在RewriteBase行和RewriteRule行的目标上都有一个斜杠。我把斜线从目的地拿走了,错误就消失了!