
28th December 2005, 22:09
|
|
Junior Member
|
|
Join Date: Dec 2005
Posts: 18
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
apache & mod_rewrite problems
Hi im running suse9.3 perfect setup
my problem is when a script is installed its using .htaccess files to control the virtual urls,
ie: http://site.com/register
not http://site.com/register.php
my apache installation shows mod_rewrite in the phpinfo but the urls are not working?
Does anyone have any idea how i can possibly find out what the problem is?
Quote:
<Files *.xslt>
SetHandler text/xml
</Files>
<IfModule !mod_php4.c>
<IfModule !mod_php5.c>
# PHP is in CGI Mode, so we need a different mod_rewrite
RewriteCond %{REQUEST_URI} !categories\.php
RewriteRule ^categories(.*) categories.php?$1 [L]
RewriteCond %{REQUEST_URI} !articles\.php
RewriteRule ^articles(.*)$ articles.php?$1 [L]
|
here is a sample of the .htaccess file controling the urls.
thanks in advance
|

28th December 2005, 22:20
|
|
Super Moderator
|
|
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 31,872
Thanks: 689
Thanked 4,184 Times in 3,202 Posts
|
|
Does your .htaccess file contains this line:
RewriteEngine On
to enable the rewrite engine before the part with the rewrite rules?
At the end of your httpd.conf is a section which limits the permissions for htaccess files:
Code:
<Directory /home/www/*/web>
Options +Includes +FollowSymlinks -Indexes
AllowOverride Indexes AuthConfig Limit FileInfo
Order allow,deny
Allow from all
<Files ~ "^\.ht">
Deny from all
</Files>
</Directory>
Maybe you must extend the allow override settings or set it even to:
AllowOverride All
But be aware that this is an security risk if you host websites for customers on your server.
Last edited by till; 28th December 2005 at 22:22.
|

28th December 2005, 22:24
|
|
Super Moderator
|
|
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 41,665
Thanks: 1,896
Thanked 2,591 Times in 2,443 Posts
|
|
What's in the Apache logs (access.log and error.log) when you try to access http://site.com/register ?
|

29th December 2005, 00:27
|
|
Junior Member
|
|
Join Date: Dec 2005
Posts: 18
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
RewriteEngine On is at the top of the .htaccess
I checked the error.log and i this is the error displayed when i view the pages,
Quote:
|
/home/www/web1/web/test/.htaccess: Options not allowed here
|
with the .htaccess file in place i get 500 internal server error.
When i remove it i can see the pages but all links are missing the .php extension.
heres the error log for when i click the link with no .php extension
|

29th December 2005, 09:26
|
|
Super Moderator
|
|
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 31,872
Thanks: 689
Thanked 4,184 Times in 3,202 Posts
|
|
Have you set "AllowOverride All" in your httpd.conf (can also be named apache.conf or apache2.conf depending on your linux distribution) as i described above? It should fix your .htaccess problem. Dont forget to restart your apache server after the change of httpd.conf.
|

29th December 2005, 10:35
|
|
Super Moderator
|
|
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 41,665
Thanks: 1,896
Thanked 2,591 Times in 2,443 Posts
|
|
Normally rewrite rules should work in an ISPConfig web site ( http://www.howtoforge.com/forums/showthread.php?t=38 ).
I guess one of the other directives is causing problems. Can you remove anything but what is related to mod_rewrite from the .htaccess file and try again?
|

2nd January 2006, 20:24
|
|
Junior Member
|
|
Join Date: Dec 2005
Posts: 18
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
i set the httpd.conf files .htaccess settings to allowoveride all and i still get a 500 internal server error?
Code:
Options +FollowSymlinks
RewriteEngine On
AddType text/xml .xslt
<Files *.xslt>
SetHandler text/xml
</Files>
<IfModule !mod_php4.c>
<IfModule !mod_php5.c>
# PHP is in CGI Mode, so we need a different mod_rewrite
RewriteCond %{REQUEST_URI} !categories\.php
RewriteRule ^categories(.*) categories.php?$1 [L]
RewriteCond %{REQUEST_URI} !articles\.php
RewriteRule ^articles(.*)$ articles.php?$1 [L]
RewriteCond %{REQUEST_URI} !pages\.php
RewriteRule ^pages(.*)$ pages.php?$1 [L]
RewriteCond %{REQUEST_URI} !blogs\.php
RewriteRule ^blogs(.*)$ blogs.php?$1 [L]
RewriteCond %{REQUEST_URI} !search.php
RewriteRule ^search(.*)$ search\.php?$1 [L]
RewriteCond %{REQUEST_URI} !authors.php
RewriteRule ^authors(.*)$ authors\.php?$1 [L]
RewriteCond %{REQUEST_URI} !articlerss.php
RewriteRule ^articlerss(.*)$ articlerss\.php?$1 [L]
RewriteCond %{REQUEST_URI} !news.php
RewriteCond %{REQUEST_URI} !newsrss.php
RewriteRule ^news(.*)$ news.php?$1 [L]
RewriteCond %{REQUEST_URI} !contact.php
RewriteRule ^contact(.*)$ contact\.php?$1 [L]
</IfModule>
<IfModule mod_php5.c>
# Using PHP 5 in module mode
RewriteCond %{REQUEST_URI} categories.*
RewriteRule ^categories(.*)$ categories.php?$1 [T=application/x-httpd-php,L]
RewriteCond %{REQUEST_URI} articles.*
RewriteRule ^articles(.*)$ articles.php?$1 [T=application/x-httpd-php,L]
RewriteCond %{REQUEST_URI} pages.*
RewriteRule ^pages(.*)$ pages.php?$1 [T=application/x-httpd-php,L]
RewriteCond %{REQUEST_URI} blogs.*
RewriteRule ^blogs(.*)$ blogs.php?$1 [T=application/x-httpd-php,L]
RewriteCond %{REQUEST_URI} search.*
RewriteRule ^search(.*)$ search.php?$1 [T=application/x-httpd-php,L]
RewriteCond %{REQUEST_URI} authors.*
RewriteRule ^authors(.*)$ authors.php?$1 [T=application/x-httpd-php,L]
RewriteCond %{REQUEST_URI} articlerss.*
RewriteRule ^articlerss(.*)$ articlerss.php?$1 [T=application/x-httpd-php,L]
RewriteCond %{REQUEST_URI} news.*
RewriteCond %{REQUEST_URI} !newsrss
RewriteRule ^news(.*)$ news.php?$1 [T=application/x-httpd-php,L]
RewriteCond %{REQUEST_URI} contact.*
RewriteRule ^contact(.*)$ contact.php?$1 [T=application/x-httpd-php,L]
</IfModule>
</IfModule>
<IfModule mod_php4.c>
# PHP 4 in module mode
RewriteCond %{REQUEST_URI} categories.*
RewriteRule ^categories(.*)$ categories.php?$1 [T=application/x-httpd-php,L]
RewriteCond %{REQUEST_URI} articles.*
RewriteRule ^articles(.*)$ articles.php?$1 [T=application/x-httpd-php,L]
RewriteCond %{REQUEST_URI} pages.*
RewriteRule ^pages(.*)$ pages.php?$1 [T=application/x-httpd-php,L]
RewriteCond %{REQUEST_URI} blogs.*
RewriteRule ^blogs(.*)$ blogs.php?$1 [T=application/x-httpd-php,L]
RewriteCond %{REQUEST_URI} search.*
RewriteRule ^search(.*)$ search.php?$1 [T=application/x-httpd-php,L]
RewriteCond %{REQUEST_URI} authors.*
RewriteRule ^authors(.*)$ authors.php?$1 [T=application/x-httpd-php,L]
RewriteCond %{REQUEST_URI} articlerss.*
RewriteRule ^articlerss(.*)$ articlerss.php?$1 [T=application/x-httpd-php,L]
RewriteCond %{REQUEST_URI} news.*
RewriteCond %{REQUEST_URI} !newsrss
RewriteRule ^news(.*)$ news.php?$1 [T=application/x-httpd-php,L]
RewriteCond %{REQUEST_URI} contact.*
RewriteRule ^contact(.*)$ contact.php?$1 [T=application/x-httpd-php,L]
</IfModule>
here is my httpd.conf
Code:
# forbid access to the entire filesystem by default
<Directory />
Options +Includes +FollowSymlinks -Indexes
AllowOverride all
Order allow,deny
Allow from all
</Directory>
# use .htaccess files for overriding,
AccessFileName .htaccess
# and never show them
<Files ~ "^\.ht">
Deny from all
</Files>
ive tried changing and restarting the apache server with no luck?
|

2nd January 2006, 21:34
|
|
Super Moderator
|
|
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 31,872
Thanks: 689
Thanked 4,184 Times in 3,202 Posts
|
|
If you use ISPConfig, the code you posted does not affect the ISPConfig websites at all. You must search for this directory directive
"<Directory /home/www/*/web>" and not for "<Directory />"
|

9th July 2008, 04:29
|
|
Member
|
|
Join Date: Jul 2008
Posts: 55
Thanks: 3
Thanked 0 Times in 0 Posts
|
|
500 internal server error
i have a fresh install of ISPConfig
i am having this same problem
did you solve yours?
we use several different htaccess files
every one of them gives me the err
500 internal server error
this is mission critial for me...
i cannot even find the file httpd.conf -- what is the server path to this file?
in my old server - we enabled htaccess on a persite basis like this >
<Directory /home/.sites/120/site53/web>
Options -Indexes
AllowOverride All
</Directory>
is thsi something we can use here?
where is the httpd.conf file
thank you
|

9th July 2008, 06:36
|
|
Member
|
|
Join Date: Jul 2008
Posts: 55
Thanks: 3
Thanked 0 Times in 0 Posts
|
|
finally i found this
.............
very easy to do!
many thanks to hans
...............................
Probably .htaccess files are not allowed on your system.
You can add the following to the Apache directives field of your website:
<Directory "/var/www/web1/web">
Options FollowSymLinks
AllowOverride All
</Directory>
Where, web1 is your own webnumber.
__________________
Hans
|
| Thread Tools |
|
|
| Display Modes |
Linear Mode
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
All times are GMT +2. The time now is 10:47.
|
Recent comments
1 day 10 hours ago
1 day 13 hours ago
1 day 14 hours ago
1 day 16 hours ago
1 day 17 hours ago
1 day 19 hours ago
1 day 20 hours ago
2 days 12 hours ago
2 days 13 hours ago
2 days 16 hours ago