Confusion about Site url and directory

I have installed my wordpress in root/mysubfolder
so my standard path is example1.com/mysubfolder (example1.com is the domain i have registered the webspace with)

Now i want the wordpress installation to work with example2.com (registered another domain)
Therefore i have set the redirect for example2.com to the folder mysubfolder in my webspace admin area

Read More

what do i have to change to get this to work?

i have tried this in the wp-config.php file:

define('WP_HOME','http:example2.com');
define('WP_SITEURL','http:example2.com');

it works for the wp-admin and the homesite.. but if i click on a post the path is example2.com/post1 ..which doesn’t work

Related posts

3 comments

  1. If I understand your question correctly you will need to adjust the above code to the following:

    define('WP_HOME','http:example2.com/yoursubfolder/');
    define('WP_SITEURL','http:example2.com/yoursubfolder/');
    

    Give that a try.

    EDIT:
    you are missing the slashes on the http also –

    define('WP_HOME','http://example2.com/yoursubfolder/');
    define('WP_SITEURL','http://example2.com/yoursubfolder/');
    
  2. If I understand correctly, you want the myexample2.com to be the root of your WP installation? In other words:

    http://myexample.com/subfolder = http://myexample2.com
    http://myexample.com/subfolder/post1 = http://myexample2.com/post1
    

    If that’s the case, then you simply need to set your “WordPress Site URL” and “WordPress Address URL” to myexample2.com. Then in your hosting account point myexample2.com domain to myexample.com/subfolder. All my sites are hosted this way.

  3. i forgot to edit the .htacess in my folder… 🙂 now everything works fine!

Comments are closed.