0

I am having two domains https:www.site.com and https:www.site2.sa which is pointed to same IP.

www.site2.sa is added as addon domain.

I have put files for www.site.com in public_html and files for www.site2.com is in public_html/site2.sa

The website is in cakePHP

www.site.com is working properly. www.site2.com is showing 500 internal server error

Should I change something in database? or should i do something in .htaccess?

My .htaccess in public_html is

# BEGIN GD-SSL
<IfModule mod_rewrite.c>
Options +FollowSymLinks
RewriteEngine On
RewriteCond %{HTTPS} !=on
RewriteCond %{HTTP_USER_AGENT} ^(.+)$
RewriteCond %{SERVER_NAME} ^site\.com$ [OR]
RewriteCond %{SERVER_NAME} ^www\.site\.com$
RewriteRule .* https://%{SERVER_NAME}%{REQUEST_URI} [R=301,L]
Header add Strict-Transport-Security "max-age=300"
</IfModule>
# END GD-SSL

<IfModule mod_rewrite.c>
RewriteEngine on
RewriteRule    ^$    webroot/    [L]
RewriteRule    (.*) webroot/$1    [L]
</IfModule>
codieboie
  • 52
  • 2
  • 10
  • http status 500 say exactly what you wrote: internal error. So you need to find out what that error actually is. For that you need to take a look into your http servers error log file. – arkascha Sep 24 '18 at 05:28
  • @arkascha i checked it but error log is empty – codieboie Sep 24 '18 at 05:40
  • i think some issue with htaccess – codieboie Sep 24 '18 at 05:40
  • An http status 500 will _never_ leave an empty log file. _Unless_ you specifically switched logging off (which you probably dir NOT do) or you are looking into the wrong file. You need to find that log file, also for future issues. You _can not_ develop and maintain web content without monitoring that log file. – arkascha Sep 24 '18 at 05:48

1 Answers1

0

This code worked for me

 <IfModule mod_rewrite.c>
 RewriteEngine on
 RewriteCond %{HTTP_HOST} ^site\.com [NC] 
 RewriteRule    ^(.*)$ webroot/$1 [L]

 RewriteCond %{HTTP_HOST} ^site2\.sa [NC]
 RewriteRule    ^(.*)$ site2.sa/webroot/$1 [L]
</IfModule>

but images from webroot are not loading now. some one have the solution?

codieboie
  • 52
  • 2
  • 10