3

我正在尝试配置.htaccess我的网站。 http://213.175.210.49/~incisozl/是 root( ~/public_html/) 的临时 URL。

当我尝试重写网址时,.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指向域一起使用时它工作正常

4

2 回答 2

1

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

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

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

于 2010-03-30T20:27:56.627 回答
1

这已经过时了,但我刚刚遇到了这个问题,对我来说,问题是 RewriteBase 行和 RewriteRule 行的目的地都有一个斜线。我从目的地去掉了斜线,错误就消失了!

于 2016-11-30T06:47:19.217 回答