ispCP - Board - Support
[solved] having a .htaccess file causes server (500) errors... - Printable Version

+- ispCP - Board - Support (http://www.isp-control.net/forum)
+-- Forum: ispCP Omega Support Area (/forum-30.html)
+--- Forum: Usage (/forum-34.html)
+--- Thread: [solved] having a .htaccess file causes server (500) errors... (/thread-2221.html)

Pages: 1 2


[solved] having a .htaccess file causes server (500) errors... - psygarden - 01-24-2008 02:37 AM

I remember having this issue with vhcs2 and now i've run into it with ispcp, i hope there's a solution, or that i'm just making a dumb mistake that i can fix easely!

the problem is that i need to be able to rewrite urls using mod-rewrite. Now as soon as i have a .htaccess file in my htdocs folder i get "Error 500! - Internal Server Error!" errors.

Here is most of my .htaccess file:

Quote:RewriteEngine on
Options +FollowSymLinks


ErrorDocument 400 /error.php?400
ErrorDocument 401 /error.php?401
ErrorDocument 403 /error.php?403
ErrorDocument 404 /error.php?404
ErrorDocument 500 /error.php?500


#assign custompage to site index
DirectoryIndex news.php
DirectoryIndex index.php
DirectoryIndex index.html
DirectoryIndex index.htm

#Fix for the page redirect na Login
#RewriteRule ^page.php$ / [R]

#Fix For the CustomLogin in The Header
RewriteRule ^gallery/index.php(\?logout) /index.php?%1 [L]
RewriteRule ^gallerysitemap.xml http://www.psygarden.net/gallery/index.php?g2_view=sitemap.Sitemap [L]

RewriteRule ^gallery/v/([^?]+)(\?.|\ .) /e107_plugins/gallery2/gallery2.php?g2_path=%1 [QSA,L]

RewriteRule ^gallery/$ /e107_plugins/gallery2/gallery2.php$1 [L]
RewriteRule ^gallery$ /e107_plugins/gallery2/gallery2.php$1 [L]
RewriteRule ^gallery/index.php(.*) /e107_plugins/gallery2/gallery2.php$1 [L]


RewriteRule ^gallery/signup.php /signup.php [L]
RewriteRule ^gallery/e107_admin/admin.php /e107_admin/admin.php [L]
RewriteRule ^gallery/user.php(.*) /user.php%1 [L]
RewriteRule ^gallery/usersettings.php /usersettings.php [L]

# BEGIN Url Rewrite section
# (Automatically generated. Do not edit this section)
<IfModule mod_rewrite.c>
Options +FollowSymlinks
RewriteEngine On

RewriteBase /g2/

RewriteCond %{REQUEST_FILENAME} -f [OR]
RewriteCond %{REQUEST_FILENAME} -d [OR]
RewriteCond %{REQUEST_FILENAME} gallery\_remote2\.php
RewriteCond %{REQUEST_URI} !/gallery2/main\.php$
RewriteRule . - [L]

RewriteCond %{THE_REQUEST} /gallery/popular(\?.|\ .)
RewriteCond %{REQUEST_URI} !/gallery/main\.php$
RewriteRule . /e107_plugins/gallery2/gallery2.php?g2_view=dynamicalbum.PopularAlbum [QSA,L]
RewriteCond %{THE_REQUEST} /gallery/updates(\?.|\ .)
RewriteCond %{REQUEST_URI} !/gallery/main\.php$
RewriteRule . /e107_plugins/gallery2/gallery2.php?g2_view=dynamicalbum.UpdatesAlbum [QSA,L]
RewriteCond %{THE_REQUEST} /gallery/random(\?.|\ .)
RewriteCond %{REQUEST_URI} !/gallery/main\.php$
RewriteRule . /e107_plugins/gallery2/gallery2.php?g2_view=dynamicalbum.RandomAlbum [QSA,L]
RewriteCond %{THE_REQUEST} /gallery/d/([0-9]+)-([0-9]+)/([^/?]+)(\?.|\ .)
RewriteCond %{REQUEST_URI} !/gallery/main\.php$
RewriteRule . /e107_plugins/gallery2/gallery2.php?g2_view=core.DownloadItem&g2_itemId=%1&g2_serialNumber=%2&g2_file$
RewriteCond %{THE_REQUEST} /gallery/v/([^?]+)(\?.|\ .)
RewriteCond %{REQUEST_URI} !/gallery/main\.php$
RewriteRule . /e107_plugins/gallery2/gallery2.php?g2_path=%1 [QSA,L]
</IfModule>

Does anyone have suggestions how to get a working setup while using all these rewrite rules?

Kind regards,
Rik


RE: having a .htaccess file causes server (500) errors... - BeNe - 01-24-2008 02:54 AM

Did you checked your /etc/apache2/sites-enabled/ispcp.conf about
Code:
Options -Indexes Includes FollowSymLinks MultiViews
        AllowOverride All
        Order allow,deny
        Allow from all
If you deny here the FollowSymLinks you can not enable it in your .htaccess. Next is that FastCGI can not understand ALL values in the .htaccess.

Please check your error.log for more info!

Greez BeNe


RE: having a .htaccess file causes server (500) errors... - psygarden - 01-24-2008 04:21 AM

BeNe Wrote:Did you checked your /etc/apache2/sites-enabled/ispcp.conf about
Code:
Options -Indexes Includes FollowSymLinks MultiViews
        AllowOverride All
        Order allow,deny
        Allow from all
If you deny here the FollowSymLinks you can not enable it in your .htaccess. Next is that FastCGI can not understand ALL values in the .htaccess.

Please check your error.log for more info!

Greez BeNe

Those settings are correct for that config file, is there any way that i can disable FastCGI after a website has been created ? mod rewrite is very important for all my sites...


RE: having a .htaccess file causes server (500) errors... - BeNe - 01-24-2008 04:26 AM

Quote:is there any way that i can disable FastCGI after a website has been created ?
You can try to change to mod_fcgid...but i dont konw if this is a solution for your Problem.
Try to set it directly in the apache2 config for the vhost.
Not that nice way but it should work there.

Greez BeNe


RE: having a .htaccess file causes server (500) errors... - joximu - 01-24-2008 04:32 AM

You also could try to find out, which line is throwing the error.
Normally you also have some infos in the error.log of apache...


RE: having a .htaccess file causes server (500) errors... - raphael - 01-24-2008 05:17 AM

Quote:Next is that FastCGI can not understand ALL values in the .htaccess.
ugh? fastcgi doesn't parse the .htaccess files, apache does


RE: having a .htaccess file causes server (500) errors... - BeNe - 01-24-2008 05:43 AM

Quote:ugh? fastcgi doesn't parse the .htaccess files, apache does
*damn* Ok - this was my fault i was thinking at htscanner but this only for php values Rolleyes. And these directive is for mod_rewrite and has nothing do to PHP. Sorry!

Greez BeNe


RE: having a .htaccess file causes server (500) errors... - psygarden - 01-25-2008 07:35 AM

Resolved Wink


RE: having a .htaccess file causes server (500) errors... - BeNe - 01-25-2008 08:18 AM

Does it work now ?
What was the Problem ?

Greez BeNe


RE: having a .htaccess file causes server (500) errors... - psygarden - 01-25-2008 08:23 AM

BeNe Wrote:Does it work now ?
What was the Problem ?

Greez BeNe

I can't use the following statements in the default debian setup:

Quote:Documentroot someting.html
Options +FollowSymlinks
ErrorDocument 400 /error.php?400
ErrorDocument 401 /error.php?401
ErrorDocument 403 /error.php?403
ErrorDocument 404 /error.php?404
ErrorDocument 500 /error.php?500

If i remove those lines that all the rest seems to be working!