Turn off searching for .htaccess and problem with Rewrite

bartkob

Verified User
Joined
Sep 12, 2007
Messages
27
Hello,

I want to turn off searching for .htaccess in my DA Server.

I added in httpd.conf:
Code:
<Directory /*>
AllowOverride None
</Directory>

Include /etc/httpd/conf/extra/httpd-htaccess.conf

In httpd-htaccess.conf I can manually add RewriteRules, for example:

Code:
<Directory /home/user/domains/domain.com/public_html/>
RewriteEngine On
RewriteRule ^([A-z]*)/([A-z]+) ?class=$1&method=$2
</Directory>

Unfortunatelly, my RewriteRules doesn't work when I use SSL.

http://domain.com and https://domain.com work good

http://domain.com/A/B - works, but https://domain.com/A/B doesn't work. It give 404 error, because off lack of rewrite_rules. It worked with .htaccess files.

How should I add <Directory> to httpd-htaccess.conf to work both with SSL and normal HTTP?
 
I made it works, by wildcard in Directory, but only for domain.com, not subdomains:

It works for http://domain.com and https://domain.com
Code:
<Directory /home/user/domains/domain.com/p*_html/>
RewriteEngine On
RewriteRule ^([A-z]*)/([A-z]+) ?class=$1&method=$2
</Directory>
It includes public_html and private_html and this is the reason why it works now. I don't know if this good method.


Unfortunately, it doesn't work with subdomains :/

Code:
<Directory /home/user/domains/domain.com/p*_html/subdomain/>
RewriteEngine On
RewriteRule ^([A-z]*)/([A-z]+) ?class=$1&method=$2
</Directory>


Two separate entries works:
Code:
<Directory /home/user/domains/domain.com/public_html/subdomain/>
RewriteEngine On
RewriteRule ^([A-z]*)/([A-z]+) ?class=$1&method=$2
</Directory>

Code:
<Directory /home/user/domains/domain.com/private_html/subdomain/>
RewriteEngine On
RewriteRule ^([A-z]*)/([A-z]+) ?class=$1&method=$2
</Directory>

But I have many subdomains with different RewriteRules. I'd like to avoid duplicate entries which is prone to errors.
 
Last edited:
Back
Top