Friendly URL Without .htaccess
Hello everyone, first off all i'm apologize for my basic english.
Well, something weird begin to ocour in my server.
All web files (.html or .php) without .htaccess in public_html and without any kind of rewrite rule can be accessed using /file-name
Example:
domain.com/test.html can be access with domain.com/test (the content is load)
domain.com/test2.php can be access with domain.com/test2 (the content is load too)
I check all types of logs (apache, php, etc)
The server running: Cloudlinux 6.8 + Apache 2.2.9 with mod_rewrite + Alt-PHP (5.4 to 7.1)
Follow the VirtualHost (httpd.conf)
Someone have any idea what's happening?
ServerName domain.com
ServerAlias mail.domain.com www.domain.com
DocumentRoot /home/username/public_html
ServerAdmin webmaster@domain.com
UseCanonicalName Off
CustomLog /usr/local/apache/domlogs/domain.com combined
CustomLog /usr/local/apache/domlogs/domain.com-bytes_log "%{%s}t %I .\n%{%s}t %O ."
## User username # Needed for Cpanel::ApacheConf
UserDir disabled
UserDir enabled username
suPHP_UserGroup username username
php_admin_value open_basedir "/home/username:/usr/lib/php:/usr/local/lib/php:/tmp"
php_admin_value open_basedir "/home/username:/usr/lib/php:/usr/php4/lib/php:/usr/local/lib/php:/usr/local/php4/lib/php:/tmp"
SuexecUserGroup username username
RMode config
RUidGid username username
# For more information on MPM ITK, please read:
# http://mpm-itk.sesse.net/
AssignUserID username username
Someone have any idea what's happening?
-
Hi @owsbr This is done using mod_rewrite rules. My assumption is that it would be in an .htaccess. Since you noted that there isn't one in public_html you may want to check directories above /home/$user/public_html for one. You may also want to check the presence of apache includes as this could potentially be managed in an include to the Apache configuration. Thanks! 0 -
Thank you for reply, I check line per line and find this (bold): Include "/usr/local/apache/conf/includes/pre_main_global.conf" Include "/usr/local/apache/conf/includes/pre_main_2.conf" LoadModule hostinglimits_module /usr/local/apache/modules/mod_hostinglimits.so LoadModule rpaf_module modules/mod_rpaf-2.0.so LoadModule bwlimited_module modules/mod_bwlimited.so LoadModule bw_module modules/mod_bw.so Include "/usr/local/apache/conf/php.conf" Include "/usr/local/apache/conf/modhostinglimits.conf" Include "/usr/local/apache/conf/mod_bandwidth.conf" Include "/usr/local/apache/conf/includes/errordocument.conf" Include "/usr/local/apache/conf/includes/account_suspensions.conf" Include "/usr/local/apache/conf/modsec2.conf" ErrorLog "logs/error_log" DefaultType text/plain ScriptAliasMatch ^/?controlpanel/?$ /usr/local/cpanel/cgi-sys/redirect.cgi ScriptAliasMatch ^/?cpanel/?$ /usr/local/cpanel/cgi-sys/redirect.cgi ScriptAliasMatch ^/?kpanel/?$ /usr/local/cpanel/cgi-sys/redirect.cgi ScriptAliasMatch ^/?securecontrolpanel/?$ /usr/local/cpanel/cgi-sys/sredirect.cgi ScriptAliasMatch ^/?securecpanel/?$ /usr/local/cpanel/cgi-sys/sredirect.cgi ScriptAliasMatch ^/?securewhm/?$ /usr/local/cpanel/cgi-sys/swhmredirect.cgi ScriptAliasMatch ^/?whm/?$ /usr/local/cpanel/cgi-sys/whmredirect.cgi ScriptAliasMatch ^/autodiscover/autodiscover.xml /usr/local/cpanel/cgi-sys/autodiscover.cgi ScriptAliasMatch ^/Autodiscover/Autodiscover.xml /usr/local/cpanel/cgi-sys/autodiscover.cgi ScriptAliasMatch ^/?webmail(/.*|/?)$ /usr/local/cpanel/cgi-sys/wredirect.cgi RewriteEngine on AddType text/html .shtml Alias /bandwidth /usr/local/bandmin/htdocs/ Alias /img-sys /usr/local/cpanel/img-sys/ Alias /sys_cpanel /usr/local/cpanel/sys_cpanel/ ScriptAlias /cgi-sys /usr/local/cpanel/cgi-sys/ Options ExecCGI FollowSymLinks Includes IncludesNOEXEC Indexes MultiViews SymLinksIfOwnerMatch AllowOverride All Options Includes Indexes FollowSymLinks AllowOverride None Order allow,deny Allow from all Order allow,deny Deny from all Satisfy All Order allow,deny Deny from all Satisfy All LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined LogFormat "%h %l %u %t \"%r\" %>s %b" common CustomLog "logs/access_log" common LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\" %I %O" combinedio ScriptAlias /cgi-bin/ "/usr/local/apache/cgi-bin/" AllowOverride None Options None Order allow,deny Allow from all LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined LogFormat "%h %l %u %t \"%r\" %>s %b" common LogFormat "%{Referer}i -> %U" referer LogFormat "%{User-agent}i" agent CustomLog logs/access_log common TypesConfig conf/mime.types AddType application/x-compress .Z AddType application/x-gzip .gz .tgz # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # Direct modifications to the Apache configuration file may be lost upon subsequent regeneration of the # # configuration file. To have modifications retained, all modifications must be checked into the # # configuration system by running: # # /usr/local/cpanel/bin/apache_conf_distiller --update # # To see if your changes will be conserved, regenerate the Apache configuration file by running: # # /usr/local/cpanel/bin/build_apache_conf # # and check the configuration file for your alterations. If your changes have been ignored, then they will # # need to be added directly to their respective template files. # # # # It is also possible to add custom directives to the various "Include" files loaded by this httpd.conf # # For detailed instructions on using Include files and the apache_conf_distiller with the new configuration # # system refer to the documentation at: https://go.cpanel.net/customdirectives # # # # This configuration file was built from the following templates: # # /var/cpanel/templates/apache2/main.default # # /var/cpanel/templates/apache2/main.local # # /var/cpanel/templates/apache2/vhost.default # # /var/cpanel/templates/apache2/vhost.local # # /var/cpanel/templates/apache2/ssl_vhost.default # # /var/cpanel/templates/apache2/ssl_vhost.local # # # # Templates with the '.local' extension will be preferred over templates with the '.default' extension. # # The only template updated by the apache_conf_distiller is main.default. # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # PidFile logs/httpd.pid LockFile logs/accept.lock Listen 0.0.0.0:80 Listen [::]:80 User nobody Group nobody ExtendedStatus On ServerAdmin logs@example.com.br ServerName sl18.example.net LogLevel warn # These can be set in WHM under 'Apache Global Configuration' Timeout 300 TraceEnable Off ServerSignature Off ServerTokens ProductOnly FileETag None StartServers 15 MinSpareServers 15 MaxSpareServers 20 MinSpareServers 15 MaxSpareServers 20 ServerLimit 512 MaxClients 300 MaxRequestsPerChild 10000 KeepAlive On KeepAliveTimeout 5 MaxKeepAliveRequests 100 RewriteEngine on RewriteMap LeechProtect prg:/usr/local/cpanel/bin/leechprotect RewriteLock /usr/local/apache/logs/rewrite_lock # Set UserDir directory for all virtual hosts, except.. UserDir public_html # when the following two modules are loaded UserDir disabled UserDir disabled # DirectoryIndex is set via the WHM -> Service Configuration -> Apache Setup -> DirectoryIndex Priority DirectoryIndex index.html.var index.htm index.html index.shtml index.xhtml index.wml index.perl index.pl index.plx index.ppl index.cgi index.jsp index.js index.jp index.php4 index.php3 index.php index.phtml default.htm default.html home.htm index.php5 Default.html Default.htm home.html # SSLCipherSuite can be set in WHM under 'Apache Global Configuration' SSLCipherSuite ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:DHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-AES128-SHA256:ECDHE-RSA-AES128-SHA256:ECDHE-ECDSA-AES128-SHA:ECDHE-RSA-AES256-SHA384:ECDHE-RSA-AES128-SHA:ECDHE-ECDSA-AES256-SHA384:ECDHE-ECDSA-AES256-SHA:ECDHE-RSA-AES256-SHA:DHE-RSA-AES128-SHA256:DHE-RSA-AES128-SHA:DHE-RSA-AES256-SHA256:DHE-RSA-AES256-SHA:ECDHE-ECDSA-DES-CBC3-SHA:ECDHE-RSA-DES-CBC3-SHA:EDH-RSA-DES-CBC3-SHA:AES128-GCM-SHA256:AES256-GCM-SHA384:AES128-SHA256:AES256-SHA256:AES128-SHA:AES256-SHA:DES-CBC3-SHA:!DSS SSLProtocol All -SSLv2 -SSLv3 SSLPassPhraseDialog builtin SSLSessionCache dbm:/usr/local/apache/logs/ssl_scache SSLSessionCacheTimeout 300 SSLMutex file:/usr/local/apache/logs/ssl_mutex SSLRandomSeed startup builtin SSLRandomSeed connect builtin Listen 0.0.0.0:443 Listen [::]:443 AddType application/x-x509-ca-cert .crt AddType application/x-pkcs7-crl .crl AddHandler cgi-script .cgi .pl .plx .ppl .perl AddHandler server-parsed .shtml AddType text/html .shtml AddType application/x-tar .tgz AddType text/vnd.wap.wml .wml AddType image/vnd.wap.wbmp .wbmp AddType text/vnd.wap.wmlscript .wmls AddType application/vnd.wap.wmlc .wmlc AddType application/vnd.wap.wmlscriptc .wmlsc SetHandler server-status Order deny,allow Deny from all Allow from 127.0.0.1 ::1 # SUEXEC is supported Include "/usr/local/apache/conf/includes/account_suspensions.conf" Include "/usr/local/apache/conf/includes/pre_virtualhost_global.conf" Include "/usr/local/apache/conf/includes/pre_virtualhost_2.conf"
Can be some of this lines?0 -
Hello @owsbr You'd need to check the contents of the includes - they are there regardless of whether or not you're using them. Thanks! 0
Please sign in to leave a comment.
Comments
3 comments