Honesty Rocks! truth rules.

Linux/ Apache /mod_rewrite Issue Error when accessing a file

HOME      >>       Programming

jlhaslip

running on Ubuntu 8.04 with an XAMPP - php5.2.5, Apache 2., etc

Getting this error when I try to access an sNews CMS which requires mod_rewrite and is installed locally:

[Mon Sep 22 05:46:00 2008][notice] Apache/2.2.8 (Unix) DAV/2 mod_ssl/2.2.8 OpenSSL/0.9.8e PHP/5.2.5 mod_apreq2-20051231/2.6.0 mod_perl/2.0.2 Perl/v5.10.0 configured -- resuming normal operations[Mon Sep 22 06:15:29 2008] [alert] [client 127.0.0.1] /opt/lampp/htdocs/jim/snews/.htaccess: RewriteBase: argument is not a valid URL
[Mon Sep 22 06:20:43 2008] [alert] [client 127.0.0.1] /opt/lampp/htdocs/jim/snews/.htaccess: RewriteBase: argument is not a valid URL


Using this link: LOCALHOST/jim/snews/snews16_email/ with an .htaccess is as follows:

<IfModule mod_php4.c>php_value session.use_trans_sid 0
</IfModule>
<IfModule mod_security.c>
SecFilterEngine Off
SecFilterScanPOST Off
</IfModule>
RewriteEngine On
RewriteBase /snews/snews16_email
RewriteCond %{REQUEST_FILENAME} -f
RewriteRule ^(.*) $1 [L]RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?category=$1 [L]
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^([a-z_]+)/([^/]+) index.php?category=$1&title=$2 [L]
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^([a-z_]+)/([^/]+)/([^/]+)/ index.php?category=$1&title=$2&commentspage=$3 [L]
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^([a-z0-9_-]+)/([0-9]+)/ index.php?category=$1 articlespage=$2 [L]


I have tried all combinations of the rewriteBase imaginable, but still can't get the Internal Error to go away. Combinations from home/jim/www/snews/snews16_email to snews/snews16_email .

The folder being used to contain the files is not in the htdocs folder, I have a symbolic link (short-cut) pointing to a User account folder instead.
Is this the issue? and how do I overcome this problem so that I can test locally? The Server works flawlessly for applications not requiring the mod-rewrite, so it seems to be an issue in the handling of the short-cut, I think.

Thanks for having a look.

truefusion

Try this:

Replace the RewriteBase line with this one:

RewriteBase /jim/snews/snews16_email


jlhaslip

Try this:
Replace the RewriteBase line with this one:

RewriteBase /jim/snews/snews16_email
fails with the same error.
I have used that and several other combinations to no avail... including /jim/www/snews... etc

truefusion

Hmm. Have you also tried these?:/snews/jim/snewsIf so, try just commenting out the line. I've installed sNews on my side, and it works with and without RewriteBase (if RewriteBase is /snews, that is).Messing around with it, i tried /snews2 for RewriteBase, and clicking on the links says that it can't find /snews2/index.php. If i comment out the RewriteBase line, everything works again. I haven't fully studied the source code yet, but it seems that if RewriteBase is commented out, it defaults to $db['website'].


jlhaslip

Issue Resolved...(simply deleted the .htaccess file in the folder above) Seems that the .htaccess (and mod-rewrite) is hierarchical. Top Dog wins.