0

I am really difficulties in using relative root url. I installed my wordpress site /root/mywordpress/tester1 folder and when I installed my wordpress sites with my subdomain like http://mywordpress.mydomain.com/tester1. It doesn't work and all images are broken.

Here is my use in wp-config.php file

    define('WP_HOME', 'http://' . $_SERVER['HTTP_HOST'].'/tester1/');
    define('WP_SITEURL', 'http://' . $_SERVER['HTTP_HOST'].'/tester1/');
    define('WP_CONTENT_URL', 'tester1/wp-content');
    define('DOMAIN_CURRENT_SITE', $_SERVER['HTTP_HOST'] .'/tester1/');

Is there better solutions for using relative root url for installing wordpress in folder of subdomain

2
  • 1
    I'm not very sure what is it excatly what your asking. Am I right to assume that you moved your wordpress installation from the main directory to a subdirectory? Commented Feb 14, 2014 at 7:57
  • $_SERVER is not really reliable for various reasons. One is, that every internal connection or every command line call won't have the data available. And that's probably the problem you're facing. What's your exact use case? Please file an edit and explain it.
    – kaiser
    Commented Feb 14, 2014 at 10:39

1 Answer 1

1

update the fields in general settings in wp-admin. I think it will solve your issue. please make sure that you will not give any static path for any image

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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