Subject: url rewrite doesn`t work

Posted on: 22/07/10 05:32am
By: guganbl

I have found this error message after turning on url rewrite :
URL Class: number of names passed to setArgNames must be equal or greater than number of arguments found in URL

I searched our forums and found like a million problems with this thing but didn`t found solution.

I found this on FAQ :
Why aren't rewriten links working (url_rewrite)?

1. Note that URL rewriting does not work under MS IIS

2. Check to make sure that the cofiguration variable $_CONF['url_rewrite'] is set to true.

3. If safe_mode is enabled on your php installation or for the geeklog directory, you must add "AcceptPathInfo On" or similar to your web server configuration file. See the documetation for your web server (apache).

FAQ Manager » Common problems » Why aren't rewriten links working (url_rewrite)?

So i think that "AcceptPathInfo On" is the problem but can`t find a way to add it.
I have access to two files regarding apache configuration on my hosting
1. .htaccess
2. php.ini

nothing more.

What can i do to resolve this.
I have read apache docs , and spend hours trying to figure this one out.
Is there something i need to add to my .htaccess , and it yes what and where ?

Kindest regards

Re: url rewrite doesn`t work

Posted on: 22/07/10 02:24pm
By: Dirk

According to the Apache manual, AcceptPathInfo can be set in a .htacces. Did you try it? Your hosting service may have disabled that ability, though.

bye, Dirk

Re: url rewrite doesn`t work

Posted on: 22/07/10 06:36pm
By: guganbl

Hi Dirk,

Yes i have tryed to insert the line in .htaccess but it didnt work, If i insert the line in the file i get internal server error 500 when i try to open any web site hosted there.

Here is what i have in .htaccess:

# -FrontPage-

IndexIgnore .htaccess */.??* *~ *# */HEADER* */README* */_vti*
<Limit GET POST>
order deny,allow
deny from all
allow from all
order deny,allow
deny from all
# attempts to stop the Santy worm
RewriteEngine On
RewriteCond %{QUERY_STRING} ^(.*)wget%20 [OR]
RewriteCond %{QUERY_STRING} ^(.*)echr(.*) [OR]
RewriteCond %{QUERY_STRING} ^(.*)esystem(.*) [OR]
RewriteCond %{QUERY_STRING} ^(.*)highlight=%2527 [OR]
RewriteCond %{HTTP_USER_AGENT} lwp-trivial [NC,OR]
RewriteCond %{HTTP_COOKIE}% sFrown.*):%22test1%22%3b
RewriteRule ^.*$ [L,R=301]
# Referrer spam :-(
RewriteCond %{HTTP_REFERER} ^http://.**$ [NC,OR]
RewriteCond %{HTTP_REFERER} ^http://.**$ [NC]
RewriteRule ^.*$ [L,R=301]
ErrorDocument 404 /404.php
Redirect 403 /xvc/config.php
Redirect 403 /xvc/db-config.php

where would you put that "AcceptPathInfo On" line?
I tryed on few different lines but every time it is the same error......


Re: url rewrite doesn`t work

Posted on: 07/08/10 10:28am
By: guganbl

Ok , i wrote to my hosting support and here is the answer , but i still cant figure out how to make it work.
As i get it i turn on url_rewrite in geeklog and then i should put some code in my .htaccess file , but that part i wasn`t able to do.

Here is what support told me :

Thank you for contacting Online Support.
Mod_rewrite is an Apache Web server module installed on all of our Linux servers by default; it does not have to be installed or enabled. Our Linux hosting accounts support most mod_rewrite functions.

Because enabling mod_rewrite is handled at a global level, you do not need to enable it in your httpd.conf file. You only need to add the desired code to the body of your .htaccess file.

Our environment uses the vendor-provided code from Apache for mod_rewrite. Current Apache HTTPD documentation is accurate with regard to how to use .htaccess files.

For more information about mod_rewrite see the Apache Module mod_rewrite documentation.

NOTE: The .htaccess file containing the rewrite rules must be in the same directory as the target files.

Anyone have any idea what should i do with my .htacces file ? what code to insert and where. text from file is in the post so any tip would be great help.

Re: url rewrite doesn`t work

Posted on: 07/08/10 10:43am
By: Dirk

Your hosting service misunderstood the problem. Geeklog's url_rewrite option does not use the Apache mod_rewrite module. Instead, it relies on the fact that you can simply attach stuff to the end of a URL and then read that from PHP.

So, for example, .../index.php is a script. You can just add random bits to the URL, e.g. .../index.php/some/more/stuff/here

Geeklog then checks the $_SERVER['PATH_INFO'] variable in PHP which would normally contain all those added pieces.

That doesn't seem to work on your server. If it's an Apache server, then what usually helps is to use the "AcceptPathInfo On" directive. Whether you can use that directive in a .htaccess or if your hosting service has to enable that globally in the webserver's configuration is something that you need to check with them.

bye, Dirk

Geeklog - Forum