Cannot run scripts that use modrewrite

Status
Not open for further replies.

tablecat

New Member
Messages
13
Reaction score
0
Points
0
I am able to run scripts that do not need modrewrite.

However, the scripts that need it, they come up with errors.

I checked the error log and that is empty.

Also, the hosting panel STILL says that my account is suspended, when clearly it is not, as I have access to my website. My website is http://tablecat.co.cc/
 

masshuu

Head of the Geese
Community Support
Enemy of the State
Messages
2,293
Reaction score
50
Points
48
I have unsuspended you.
Can you post the .htaccess that has the mod-rewrite, and the name of the script that requires it.

[edit]
In the folder with the script, there should be a file called "error_log". Open that and look at it.
 
Last edited:

tablecat

New Member
Messages
13
Reaction score
0
Points
0
I have checked the folders in question and there is no file named error_log

The scripts are located @ http://tablecat.co.cc/lounge/

Two examples are http://tablecat.co.cc/lounge/post and http://tablecat.co.cc/lounge/all

It says that the server cannot find the appropriate files, but they are there.

Here is the .htaccess file:

Code:
DirectoryIndex index.html
AddCharset utf-8 html

<Files config.pl>
Deny from all
</Files>

<Files log.txt>
Deny from all
</Files>

<Files ban.txt>
Deny from all
</Files>

<Files spam.txt>
Deny from all
</Files>

<IfModule mod_headers.c>
<Files *.html>
Header add Expires "Mon, 26 Jul 1997 05:00:00 GMT"
Header add Pragma "no-cache"
Header add Cache-Control "max-age=0; must-revalidate; no-cache"
Header unset Vary
</Files>
</IfModule>

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{HTTP_ACCEPT} text/html
RewriteRule \.html$ - [T=text/html;charset=utf-8]
RewriteRule ^read/([0-9]+)/?$ res/$1.html
#RewriteRule ^all$ subback.html
RewriteRule ^([a-z]+)/([0-9l\-\,\/]+)$ cgi-$1.pl?$2
RewriteRule ^([a-z]+)$ cgi-$1.pl
</IfModule>


I have these exact same set up (and scripts) operating in two other servers and they work perfectly.

If it is any help, I used the restore function on CPanel to set up this website. And yes, the files are properly CHMODed
 
Last edited:

Zubair

Community Leader
Community Support
Messages
8,766
Reaction score
305
Points
83
Try Adding RewriteBase / next to RewriteEngine On

Whole .htaccess will look like this
Code:
DirectoryIndex index.html
AddCharset utf-8 html

<Files config.pl>
Deny from all
</Files>

<Files log.txt>
Deny from all
</Files>

<Files ban.txt>
Deny from all
</Files>

<Files spam.txt>
Deny from all
</Files>

<IfModule mod_headers.c>
<Files *.html>
Header add Expires "Mon, 26 Jul 1997 05:00:00 GMT"
Header add Pragma "no-cache"
Header add Cache-Control "max-age=0; must-revalidate; no-cache"
Header unset Vary
</Files>
</IfModule>

<IfModule mod_rewrite.c>
RewriteEngine On
[B]RewriteBase /[/B]
RewriteCond %{HTTP_ACCEPT} text/html
RewriteRule \.html$ - [T=text/html;charset=utf-8]
RewriteRule ^read/([0-9]+)/?$ res/$1.html
#RewriteRule ^all$ subback.html
RewriteRule ^([a-z]+)/([0-9l\-\,\/]+)$ cgi-$1.pl?$2
RewriteRule ^([a-z]+)$ cgi-$1.pl
</IfModule>
 

tablecat

New Member
Messages
13
Reaction score
0
Points
0
That did not work.

However, I changed that line to:
Code:
RewriteBase /lounge

and it seems to be able to find the file.

The problem is that the script does nothing. When I try posting it seems to ignore the web form POST request.

It also messes up the script terribly when you go to http://tablecat.co.cc/lounge/post It's not supposed to do that. For example, that post script is set up to do this:
Code:
exit unless $ENV{'REQUEST_METHOD'} =~ /^post$/i;
Yet Somehow it ignored the EXIT command and printed out the error message for No Comment.

This is weird. On my other websites this does not happen at all. I know you are not familiar with my script, but I can assure that's not the problem. That's as much as I know at this moment.

And having to write RewriteBase /lounge is an unacceptable solution because it is not flexible at all.
 

Corey

I Break Things
Staff member
Messages
34,551
Reaction score
204
Points
63
Unfortunately we're not able to troubleshoot 3rd party scripts. If you can get an exact error or the cause of the problem we can look into it.
 
Status
Not open for further replies.
Top