M
M
MeatPixel2019-02-17 23:54:46
Apache HTTP Server
MeatPixel, 2019-02-17 23:54:46

RewriteRule index.php, how to make CNC work with HTTPS?

Good day, I’ve been racking my brain for a day now, Google doesn’t help at all, everything I try doesn’t work =(

Actually, here’s what we have now:
VDS with Apache2 + php + mysql + SSL installed, all this is on ubuntu 16.04
and an htaccess file with such content :

RewriteEngine On
    
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule ^(.*)\.(gif|jpg|png|jpeg|css|js)$ /public/$1.$2 [L,NC]

    # Removes index.php from ExpressionEngine URLs
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule ^(.*)$ index.php/$1 [L,QSA]


Actually, everything works fine with http, links like:
site.ru - works
site.ru/module/action - works

And only the main page works with https, as I would not rewrite htaccess,
site.ru - works
site.ru/ module/action - 404

at first twisted this htaccess skewer, but eventually returned to its original state (the code above) at the moment, I just registered a redirect to https in the apache config (port: 80) ( Redirect / https://site.ru / )

and run the command in the terminal:
sudo a2enmod alias
sudo service apache2 restart


Actually, how can I make links like: " site.ru/module/action " work?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
MeatPixel, 2019-02-18
@MeatPixel

I found a solution to the problem, it turned out to be a special case associated with the apache 2.4.18 bug.
It turned out that the RewriteEngine module was loaded for https, but did not work.
Help:
config: apache2.conf
changed allowoverride all
For some reason this only works from the main config.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question