• Resolved paul8998

    (@paul8998)


    Hello,

    Our website seems to use the absolute path. How can we set it up to use the relative path?

    Thank you.

    The page I need help with: [log in to see the link]

Viewing 8 replies - 1 through 8 (of 8 total)
  • Most times you can’t. And most times you don’t want to.

    There’s no advantage of using relative paths over absolute paths – infact you’re more likely to have problems using relative paths.

    Is there a reason that you think that relative paths will be better?

    Thread Starter paul8998

    (@paul8998)

    Thank you for your reply. I want to set up multiple domains for our website. Currently there are tow domains: pen1us.com and peni.us I have installed a Multiple domain plugin for that and it seems to work fine, but for example if I visit pen1us.com and when I click the logo that redirects a user to the homepage, the shop now button or if I switch to another language it redirects me back to peni.us. I was told that I should try using relative paths instead of absolute. For example instead of https://peni.us/about-us-2/ use only /about-us-2/

    How is it possible to set it up?

    That’s a completely different question.

    Are you going to use the different domains for differnt sites, different languages, or jsut parked to show the same content?

    Thread Starter paul8998

    (@paul8998)

    I want to use two domains with one hosting. There should be two different domains that render the same content. And if for example I make any change on my main website (peni.us) it should affect pen1us.com as well.

    Thread Starter paul8998

    (@paul8998)

    Yes, I actually use this plugin now, but still I couldn’t figure out how to create a relative link in WordPress. For example relative links for the logo, the shop now page and for the language switcher.

    • This reply was modified 4 years, 10 months ago by paul8998.

    Yes. You can use the MULTIPLE_DOMAIN_DOMAIN_LANG constant to get the language associated with the current domain. Keep
    in mind the value in this constant doesn’t necessarily reflect the actual user language or locale. This is just the
    language set in the plugin config. Also notice the language may be null.

    Notice: in prior versions these constants were wrongly prefixed with MULTPLE_, missing the “I”. The old constants
    are now deprecated. They still available for backcompat but will be removed in future releases.

    Shortcode

    Yes. There is a shortcode available for that. Just add [multiple_domain] to the post/page and it’ll be replaced by
    the current domain when viewing the content. You can write things like “Welcome to [multiple_domain]!”, which would be
    rendered as “Welcome to mydomain.com!”.

    Thread Starter paul8998

    (@paul8998)

    Hello. Thank you. And how can I do it using SFTP?

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘Relative path’ is closed to new replies.