R
R
ruboss2015-08-01 19:29:54
htaccess
ruboss, 2015-08-01 19:29:54

How to setup .htaccess for mvc in subdomain?

Hello! 500 Internal Server Error occurs. On subdomain ru.site.com. Problem in .htaccess

RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule .* index.php [L]

On the site.com domain, all pages are translated to index.php, but it no longer works on the subdomain.
site.com/test/1/ - works norms
and a copy of the site only on the subdomain
ru.site.com/test/1/ - gives an error 500
What could be the problem, who knows how to correctly register htaccess?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
R
ruboss, 2015-08-01
@ruboss

Managed to solve the problem by adding RewriteBase /
Now .htaccess looks like this

RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule .* index.php [L]
AddDefaultCharset UTF-8

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question