1

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

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

4
  • Post path is correct (domainname/postname). It seems what you need is a permalink flush. You said example2.com/post1 doesn't work, what is the error you get ?
    – Shazzad
    Commented Mar 3, 2014 at 17:08
  • The server encountered an internal error or misconfiguration and was unable to complete your request. contact webmaster etc...
    – Marc Ster
    Commented Mar 3, 2014 at 17:16
  • That's unusual. Is example2.com/wp-admin/ works perfectly (i see u already said that, even though) ?
    – Shazzad
    Commented Mar 3, 2014 at 17:24
  • yes thats the case.. really strange
    – Marc Ster
    Commented Mar 3, 2014 at 17:49

3 Answers 3

0

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/');
11
  • If i do that, nothing works anymore..
    – Marc Ster
    Commented Mar 3, 2014 at 17:02
  • The strane thing in my opinion is: myexample2.com equals myexample1.com/mysubfolder... and if i set the home and siteurl to myexample2.com it should work?!
    – Marc Ster
    Commented Mar 3, 2014 at 17:03
  • these values are also stored in the Database and may be overriding what is in your config file. If you have access to the DB, have a look in the wp_options table and see what the home and site URL's are set to...
    – Und3rTow
    Commented Mar 3, 2014 at 17:08
  • hm seems to be the same but i can't find the home value in the database
    – Marc Ster
    Commented Mar 3, 2014 at 17:13
  • that is usually on the second page of the options table
    – Und3rTow
    Commented Mar 3, 2014 at 17:14
0

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.

2
  • That is exactly what i have done, it isn't working though.. (only the post sites)
    – Marc Ster
    Commented Mar 3, 2014 at 17:50
  • Check to make sure the URLs are correct in the WP dashboard, not just the config. When you type in the myexample2.com/post1, does the URL terminate at myexample.com or do you just get a 404?
    – unifiedac
    Commented Mar 3, 2014 at 18:55
0

i forgot to edit the .htacess in my folder... :) now everything works fine!

1
  • Please explain your solution with more details, so future visitors will know exactly what to do.
    – fuxia
    Commented Mar 4, 2014 at 20:55

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.