Welcome to Geeklog, Anonymous Thursday, March 28 2024 @ 02:47 pm EDT

Geeklog Forums

url rewrite doesn`t work


Status: offline

guganbl

Forum User
Chatty
Registered: 05/12/07
Posts: 57
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
Sasa
:banghead:
 Quote

Status: offline

Dirk

Site Admin
Admin
Registered: 01/12/02
Posts: 13073
Location:Stuttgart, Germany
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
 Quote

Status: offline

guganbl

Forum User
Chatty
Registered: 05/12/07
Posts: 57
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
</Limit>
<Limit PUT DELETE>
order deny,allow
deny from all
</Limit>
# 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 ^.*$ http://127.0.0.1/ [L,R=301]
# Referrer spam :-(
RewriteCond %{HTTP_REFERER} ^http://.*hosting4u.gb.com.*$ [NC,OR]
RewriteCond %{HTTP_REFERER} ^http://.*4free.gb.com.*$ [NC]
RewriteRule ^.*$ http://127.0.0.1/ [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......

Frown
 Quote

Status: offline

guganbl

Forum User
Chatty
Registered: 05/12/07
Posts: 57
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.
:shakehands:
 Quote

Status: offline

Dirk

Site Admin
Admin
Registered: 01/12/02
Posts: 13073
Location:Stuttgart, Germany
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
 Quote

All times are EDT. The time is now 02:47 pm.

  • Normal Topic
  • Sticky Topic
  • Locked Topic
  • New Post
  • Sticky Topic W/ New Post
  • Locked Topic W/ New Post
  •  View Anonymous Posts
  •  Able to post
  •  Filtered HTML Allowed
  •  Censored Content