Rewrite not working

Discussion in 'Installation/Configuration' started by topogigio, Dec 27, 2023.

  1. topogigio

    topogigio Member

    Hi,
    I have an ISPConfig 3.2.11p1 running on a Deb 12 (just updated from Deb11, using the tutorial) where url rewrite does not work.
    I have a website named "000default.tld" in ISPConfig (its my default website). In /etc/apache2/sites-available/000default.tls.vhost I can see:

    <code>
    RewriteEngine on
    RewriteCond %{REQUEST_URI} ^/\.well-known/acme-challenge/
    RewriteRule ^ - [END]
    RewriteCond %{HTTP_HOST} ^000default\.tld$ [NC]

    RewriteRule ^/(.*)$ https://www.mydomain.eu [R=301,L]
    </code>

    Still, the website respond with ISPConfig default page and not with the 301 redirect.
    1. modrewrite seems enabled
    2. restarting apache2 does not change nothing
    3. access logs in website's folder contain my GET from the website, so it is really that vhost responding to mt
    4. I deleted the website (the page from the webserver was the apache2 default page) and created it back, and it is the same
    I have not other idea, someone can help me?
    thanks
     
  2. Taleman

    Taleman Well-Known Member HowtoForge Supporter

  3. till

    till Super Moderator Staff Member ISPConfig Developer

    I guess the rewrite condition is not met, you must rewrite everything and not just traffic for domain 000default.tld
     
  4. topogigio

    topogigio Member

    Here there is the log.

    The page is the default page of the website I've created. I changed it with my courtesy page and now I see that. So the website is responding is the same I've created and I'm trying to configure in ISPConfig to enable the redirect.

    So if the request is handled by the right website, I think that the redirect may work if I configured it on that website. The problem I think is not 000default.tld but the rewrite/redirect starting from that.
     

    Attached Files:

Share This Page