0

My Apache configuration for foo.com is like this

<VirtualHost _default_:443>
    ServerName foo.com
    ServerAlias foo.com

    ...    

</VirtualHost>

<VirtualHost _default_:80>
    ServerName foo.com
    ServerAlias foo.com
    Redirect permanent / https://foo.com
</VirtualHost>

If I navigate to foo.com/bar in the browser I get redirected to https://foo.combar, which is missing the forward slash between the domain and the path.

If I type https://foo.com/bar into the browser directly the site works correctly.

Why is this happening?

0

Maybe the Redirect line should be like:

Redirect permanent "/" "https://foo.com/"

Pay attention to the last / after foo.com.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.