Jump to content
xisto Community
jlhaslip

Linux/ Apache /mod_rewrite Issue Error when accessing a file

Recommended Posts

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.

Share this post


Link to post
Share on other sites

Try this:

Replace the RewriteBase line with this one:

RewriteBase /jim/snews/snews16_email

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

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'].

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...

Important Information

Terms of Use | Privacy Policy | Guidelines | We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.