N
N
novichkovv2017-09-18 19:02:25
Apache HTTP Server
novichkovv, 2017-09-18 19:02:25

Why doesn't rewrite work on a subdomain?

Rewrite in .htaccess only works on the main domain

RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?route=$1 [L,QSA]

Only the main page works on the subdomain, any other address that does not match a file or folder returns 404.
vhosts settings
<VirtualHost *:80>
ServerAdmin [email protected]
    ServerName domain.io
    ServerAlias www.domain.io cabinet.domain.io
    DocumentRoot /var/www/domain/public
    <Directory /var/www/domain/public>
        Options Indexes FollowSymLinks MultiViews
        AllowOverride All
        Require all granted
</Directory>
ErrorLog ${APACHE_LOG_DIR}/domain.io-error.log
    CustomLog ${APACHE_LOG_DIR}/domain.io-access.log combined
</VirtualHost>
<VirtualHost domain.io:443>
ServerName domain.io
    ServerAlias www.domain.io cabinet.domain.io
    SSLEngine on
    SSLCertificateKeyFile /var/www/domain/protected/domain.io.key
    SSLCertificateFile /var/www/domain/protected/domain.io.crt
    SSLCertificateChainFile /var/www/domain/protected/chain.crt
    SetEnvIf User-Agent ".*MSIE.*" nokeepalive ssl-unclean-shutdown
    DocumentRoot /var/www/domain/public
    <Directory /var/www/domain/public>
       Options Indexes FollowSymLinks   
       AllowOverride All
       Require all granted
</Directory>
</VirtualHost>

Answer the question

In order to leave comments, you need to log in

1 answer(s)
N
novichkovv, 2017-09-18
@novichkovv

I found it myself, it's all about MultiViews, after deleting everything worked

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question