Please upgrade here. These earlier versions are no longer being updated and have security issues.
HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.
Options

Wrong path category + HTTPS

Hello,

How can I set manually the domain name used to define the URL path to General Category or other.
Currently, I can't access to discussions because the generated URL is "http://domain.com; domain.com/discussion/74/..." (domain.com is in the URL twice) instead of "http://domain.com; domain.com/discussion/74/..." instead of "http://domain.com/discussion/74/..." It's wired. Is this because Users come from "https://domain.com" (HTTPS) ?

Thank you.

Vanilla 2.1.3
RED HAT 6

Comments

  • Options

    Try this to call the URI:

    <?php echo $_SERVER["HTTP_HOST"] . $_SERVER["REQUEST_URI"] ?>

  • Options

    Thank you for the reply.

    The domain is displayed like this : http://domain.com. But it's impossible to access to discussions because for the "General" category the domain is still incorrect.

  • Options
    R_JR_J Ex-Fanboy Munich Admin

    @test-vanilla said:
    Hello,

    How can I set manually the domain name used to define the URL path to General Category or other.
    Currently, I can't access to discussions because the generated URL is "http://domain.com; domain.com/discussion/74/..." (domain.com is in the URL twice) instead of "http://domain.com; domain.com/discussion/74/..." instead of "http://domain.com/discussion/74/..." It's wired. Is this because Users come from "https://domain.com" (HTTPS) ?

    Thank you.

    Vanilla 2.1.3
    RED HAT 6

    Doesn't sound like a Vanilla problem but like a .htaccess misconfiguration.
    What changes have you made to the .htaccess?
    What (domain specific) Vanilla settings have you changed?

  • Options
    x00x00 MVP
    edited May 2015

    .htaccess is just an override, it could server rules lower down too.

    grep is your friend.

  • Options

    No changes have been made to the .htaccess

    Original

    If you modify this file then change the above line to: # Modified


    RewriteEngine On
    # Certain hosts may require the following line.
    # If vanilla is in a subfolder then you need to specify it after the /.
    # (ex. You put Vanilla in /forum so change the next line to: RewriteBase /forum)
    # RewriteBase /
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteRule ^(.*)$ index.php\?p=$1 [QSA,L]

    From the menu Settings > Manage categories I see the generated link is wrong but I can't edit it. Please, is there a way to set it manually ? I don't know how vanilla create the link but it's not the right URL here.

  • Options

    Hello,

    How can I change category path manually because Vanilla create a wrong URL and I can't access to discussions. Thank you.

  • Options
    x00x00 MVP
    edited May 2015

    @test-vanilla this is detected, so it is likely a problem lower down. You need to ask you hosts to check how

    HTTP_X_FORWARDED_HOST is set.

    You can also check

    <?php
    echo isset($_SERVER['HTTP_X_FORWARDED_HOST']) ?  $_SERVER['HTTP_X_FORWARDED_HOST'] : 'not set';
    

    grep is your friend.

  • Options

    Thank you for your reply. $_SERVER['HTTP_X_FORWARDED_HOST'] returns the wrong domain. When I set at the start of index.php : $_SERVER['HTTP_X_FORWARDED_HOST'] = domain.com and it works.

  • Options
    x00x00 MVP
    edited May 2015

    @test-vanilla this is something your host should sort out, it is not a vanilla issue.

    Also don't modify the core. If you want a workaround try this:

    add php_value auto_prepend_file alter_host.php to the top of your .htaccess file

    Then create a file alter_host.php and put

    <?php
    $_SERVER['HTTP_X_FORWARDED_HOST'] = 'domain.com'; 
    

    changing to your domain

    grep is your friend.

Sign In or Register to comment.