Here is my folder structure:
Root/
sub.domainname.com/
.htaccess
app/
.htacess
webroot/
.htacess
httpdocs/
.htaccess
I'm trying to set up a subdomain for my application but server return error:500 when I call sub.domain.com
I think I config .htaccess incorrect and I have no idea to fix it to work! help me please.
*in httpdocs folder is main web files on domain >> www.domainname.com but files in this folder not Cakephp framework it's use Wordpress and in sub.domainname.com is subdomain web files to use Cakephp framework.
*I use shared hosting (http://netdesignhost.com/) lookalike GoDaddy Hosting.
Dear Variables and all ... this my .htaccess
cakephp/.htaccess
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteRule ^$ app/webroot/ [L]
RewriteRule (.*) app/webroot/$1 [L]
</IfModule>
cakephp/app/.htaccess
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteBase /app/
RewriteRule ^$ webroot/ [L]
RewriteRule (.*) webroot/$1 [L]
</IfModule>
cakephp/app/webroot/.htaccess
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /app/
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
RewriteCond %{REQUEST_URI} !^/(app/webroot/)?(img|css|js)/(.*)$
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ index.php [QSA,L]
</IfModule>
This's error logs
[Sun Sep 17 23:38:45 2017] [alert] [client 184.22.122.56] /var/www/vhosts/domain.com/sub.domain.com/.htaccess: RewriteRule: bad flag delimiters, referer: http://sub.domain.com/
[Sun Sep 17 23:42:18 2017] [error] [client 184.22.122.56] Request exceeded the limit of 10 internal redirects due to probable configuration error. Use 'LimitInternalRecursion' to increase the limit if necessary. Use 'LogLevel debug' to get a backtrace.
thank you. Pea.
cakephp/.htaccess
,cakephp/app/.htaccess
andcakephp/app/webroot/.htaccess
and your http error logs, since HTTP Status Code 500 is a generic error message. Most likely the RewriteBase is not set correctly. – polyteRewriteBase /app/
from both files and test. If this is not working try to removeRewriteCond %{REQUEST_URI} !^/(app/webroot/)?(img|css|js)/(.*)$
for debugging. – polyte