Hello,
We are experiencing an issue on a cPanel/CentOS 64-bit server where .htaccess files do not appear to be inherited. This was occurring with 4.0.19 Enterprise, and, following an upgrade and also a force-reinstall of 4.0.20, is still occurring.
given an htaccess file:
/home/username/public_html/.htaccess
and the rules:
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ /index.php [L]
any request for a nonexistent file or directory should be rewritten to a request for index.php. This happens in the given directory.
given a subdomain located at:
/home/username/public_html/subdomain
configured as a vhost in the httpd.conf, the rules are not working; going to a non-existent addresses throws a 404, though the htaccess is getting read in by lsws, according to the logs. If the .htaccess is copied the subdomain directory, it works without issue. On Apache httpd it is working without issue.
Here are the relevant log entries (with the bits referring to other rewrite rules in the same htaccess file removed):
[/usr/local/apache/conf/httpd.conf:4914] processing direcitve: CustomLog /usr/local/apache/domlogs/subdomain.address.com combined.
[/usr/local/apache/conf/httpd.conf:4915] processing direcitve: CustomLog /usr/local/apache/domlogs/subdomain.address.com-bytes_log "%{%s}t %I .\n%{%s}t %O .".
[/usr/local/apache/conf/httpd.conf:4918] processing direcitve: suPHP_UserGroup username username.
[/usr/local/apache/conf/httpd.conf:4921] processing direcitve: SuexecUserGroup username username.
[/usr/local/apache/conf/httpd.conf:4923] processing direcitve: ScriptAlias /cgi-bin/ /home/username/public_html/subdomain/cgi-bin/.
[:1] processing direcitve: php_admin_flag display_errors off.
[:1] add PHP config: display_errors off
[:2] processing direcitve: php_admin_flag safe_mode off.
[:2] add PHP config: safe_mode off
[:3] processing direcitve: RewriteEngine On.
[:3] enable rewrite engine: 1
[:4] processing direcitve: RewriteCond %{ENV:LS_AI_PATH} ^$.
[:5] processing direcitve: RewriteRule .*\.php - [F].
[10.1.252.108:64660-0#APVH_subdomain.address.com] Content len: 0, Request line: 'GET /login HTTP/1.1'
[10.1.252.108:64660-0#APVH_subdomain.address.com] Cookie len: 238, PHPSESSID=1f4c055877b6b6f8eda238a7384e139f; __utma=219045637.1895141871.1299041193.1299041193.1299041193.1; __utmb=219045637.10.10.1299041193; __utmc=219045637; __utmz=219045637.1299041193.1.1.utmcsr=(direct)|utmccn=(direct)|utmcmd=(none)
[10.1.252.108:64660-0#APVH_subdomain.address.com] Find context with URI: [/], location: [/home/username/public_html/subdomain/]
[HTAccess] Updating configuration file [/home/username/public_html/subdomain/.htaccess]
[HTAccess] Updating configuration from [/home/username/public_html/subdomain/.htaccess]
[/home/username/public_html/subdomain/.htaccess:1] processing direcitve: Options +FollowSymLinks -Indexes.
[/home/username/public_html/subdomain/.htaccess:2] processing direcitve: RewriteEngine on.
[/home/username/public_html/subdomain/.htaccess:3] processing direcitve: RewriteBase /.
[/home/username/public_html/subdomain/.htaccess:14] processing direcitve: RewriteCond %{REQUEST_FILENAME} !-f.
[/home/username/public_html/subdomain/.htaccess:15] processing direcitve: RewriteCond %{REQUEST_FILENAME} !-d.
[/home/username/public_html/subdomain/.htaccess:16] processing direcitve: RewriteRule ^(.*)$ /index.php [L].
[10.1.252.108:64660-0#APVH_subdomain.address.com] Find .htaccess context with URI: [/], location: [/home/username/public_html/subdomain/]
[10.1.252.108:64660-0#APVH_subdomain.address.com] [REWRITE] Rewrite engine is not enabled for context '/'
[10.1.252.108:64660-0#APVH_subdomain.address.com] File not found [/home/username/public_html/subdomain/login]
[10.1.252.108:64660-0#APVH_subdomain.address.com] processContextPath() return 25
[10.1.252.108:64660-0#APVH_subdomain.address.com] processNewReq() return 25.
[10.1.252.108:64660-0#APVH_subdomain.address.com] HttpConnection::sendHttpError(),code=404 Not Found^M
[10.1.252.108:64660-0#APVH_subdomain.address.com] redirect to:
URI=[/404.shtml],
QueryString=[]
[10.1.252.108:64660-0#APVH_subdomain.address.com] Find context with URI: [/], location: [/home/username/public_html/subdomain/]
[10.1.252.108:64660-0#APVH_subdomain.address.com] Find .htaccess context with URI: [/], location: [/home/username/public_html/subdomain/]
[10.1.252.108:64660-0#APVH_subdomain.address.com] File not found [/home/username/public_html/subdomain/404.shtml]
[10.1.252.108:64660-0#APVH_subdomain.address.com] Error Page, processContextPath() return 25
[10.1.252.108:64660-0#APVH_subdomain.address.com] HttpConnection::flush()!
[10.1.252.108:64660-0#APVH_subdomain.address.com] Written to client: 617
[10.1.252.108:64660-0#APVH_subdomain.address.com] HttpConnection::nextRequest()!
We are experiencing an issue on a cPanel/CentOS 64-bit server where .htaccess files do not appear to be inherited. This was occurring with 4.0.19 Enterprise, and, following an upgrade and also a force-reinstall of 4.0.20, is still occurring.
given an htaccess file:
/home/username/public_html/.htaccess
and the rules:
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ /index.php [L]
any request for a nonexistent file or directory should be rewritten to a request for index.php. This happens in the given directory.
given a subdomain located at:
/home/username/public_html/subdomain
configured as a vhost in the httpd.conf, the rules are not working; going to a non-existent addresses throws a 404, though the htaccess is getting read in by lsws, according to the logs. If the .htaccess is copied the subdomain directory, it works without issue. On Apache httpd it is working without issue.
Here are the relevant log entries (with the bits referring to other rewrite rules in the same htaccess file removed):
[/usr/local/apache/conf/httpd.conf:4914] processing direcitve: CustomLog /usr/local/apache/domlogs/subdomain.address.com combined.
[/usr/local/apache/conf/httpd.conf:4915] processing direcitve: CustomLog /usr/local/apache/domlogs/subdomain.address.com-bytes_log "%{%s}t %I .\n%{%s}t %O .".
[/usr/local/apache/conf/httpd.conf:4918] processing direcitve: suPHP_UserGroup username username.
[/usr/local/apache/conf/httpd.conf:4921] processing direcitve: SuexecUserGroup username username.
[/usr/local/apache/conf/httpd.conf:4923] processing direcitve: ScriptAlias /cgi-bin/ /home/username/public_html/subdomain/cgi-bin/.
[:1] processing direcitve: php_admin_flag display_errors off.
[:1] add PHP config: display_errors off
[:2] processing direcitve: php_admin_flag safe_mode off.
[:2] add PHP config: safe_mode off
[:3] processing direcitve: RewriteEngine On.
[:3] enable rewrite engine: 1
[:4] processing direcitve: RewriteCond %{ENV:LS_AI_PATH} ^$.
[:5] processing direcitve: RewriteRule .*\.php - [F].
[10.1.252.108:64660-0#APVH_subdomain.address.com] Content len: 0, Request line: 'GET /login HTTP/1.1'
[10.1.252.108:64660-0#APVH_subdomain.address.com] Cookie len: 238, PHPSESSID=1f4c055877b6b6f8eda238a7384e139f; __utma=219045637.1895141871.1299041193.1299041193.1299041193.1; __utmb=219045637.10.10.1299041193; __utmc=219045637; __utmz=219045637.1299041193.1.1.utmcsr=(direct)|utmccn=(direct)|utmcmd=(none)
[10.1.252.108:64660-0#APVH_subdomain.address.com] Find context with URI: [/], location: [/home/username/public_html/subdomain/]
[HTAccess] Updating configuration file [/home/username/public_html/subdomain/.htaccess]
[HTAccess] Updating configuration from [/home/username/public_html/subdomain/.htaccess]
[/home/username/public_html/subdomain/.htaccess:1] processing direcitve: Options +FollowSymLinks -Indexes.
[/home/username/public_html/subdomain/.htaccess:2] processing direcitve: RewriteEngine on.
[/home/username/public_html/subdomain/.htaccess:3] processing direcitve: RewriteBase /.
[/home/username/public_html/subdomain/.htaccess:14] processing direcitve: RewriteCond %{REQUEST_FILENAME} !-f.
[/home/username/public_html/subdomain/.htaccess:15] processing direcitve: RewriteCond %{REQUEST_FILENAME} !-d.
[/home/username/public_html/subdomain/.htaccess:16] processing direcitve: RewriteRule ^(.*)$ /index.php [L].
[10.1.252.108:64660-0#APVH_subdomain.address.com] Find .htaccess context with URI: [/], location: [/home/username/public_html/subdomain/]
[10.1.252.108:64660-0#APVH_subdomain.address.com] [REWRITE] Rewrite engine is not enabled for context '/'
[10.1.252.108:64660-0#APVH_subdomain.address.com] File not found [/home/username/public_html/subdomain/login]
[10.1.252.108:64660-0#APVH_subdomain.address.com] processContextPath() return 25
[10.1.252.108:64660-0#APVH_subdomain.address.com] processNewReq() return 25.
[10.1.252.108:64660-0#APVH_subdomain.address.com] HttpConnection::sendHttpError(),code=404 Not Found^M
[10.1.252.108:64660-0#APVH_subdomain.address.com] redirect to:
URI=[/404.shtml],
QueryString=[]
[10.1.252.108:64660-0#APVH_subdomain.address.com] Find context with URI: [/], location: [/home/username/public_html/subdomain/]
[10.1.252.108:64660-0#APVH_subdomain.address.com] Find .htaccess context with URI: [/], location: [/home/username/public_html/subdomain/]
[10.1.252.108:64660-0#APVH_subdomain.address.com] File not found [/home/username/public_html/subdomain/404.shtml]
[10.1.252.108:64660-0#APVH_subdomain.address.com] Error Page, processContextPath() return 25
[10.1.252.108:64660-0#APVH_subdomain.address.com] HttpConnection::flush()!
[10.1.252.108:64660-0#APVH_subdomain.address.com] Written to client: 617
[10.1.252.108:64660-0#APVH_subdomain.address.com] HttpConnection::nextRequest()!