WP works fine with direct link, but Don't with subdomain (9 posts)

  1. miacao
    Posted 8 years ago #

    Hi guys!

    I'm having a weird problem.

    I have a WordPress 2.3 instalation at http://www.miacao.org/wp . I did setup a subdomain http://miablog.miacao.org to point to /wp directory at my hosting plan. But it do not work. Via full path everything is fine. Via subdomain, I am redirected to www at my domain.

    Subdomain is ok.

    So, just for test, I did put an index.html at http://www.miacao.org/wp and... Eureka!!! It works! Not redirected to http://www.miacao.org . When I moved index.html the problem was back.

    Somthing It's wrong in my WP 2.3 code that redirects to root directory. Some ideas?

    Thanks in advance,


  2. MichaelH
    Posted 8 years ago #

    Well in theory, in Options->General your WordPress address (URL) and your Blog address (URL) would need to be http://miablog.miacao.org

    Please review Moving WordPress.

  3. miacao
    Posted 8 years ago #

    Hi MichaelH!

    I don't think that is the problem, but I'll try it and will be right back to give a feedback.



  4. miacao
    Posted 8 years ago #

    Hi again!

    I was right. It won't works and plus me another problem.

    Right after changed blog URL to http://miablog.miacao.org I was redirected to http://miablog.miacao.org/wp-login.php to relogin. I filled the filds with my login and password and WP complaints about cookies. I removed all privacy filters and still can't login. So I tryed http://www.miacao.org/wp/wp-login.php and i did log into WP and turn changes back and everything was functional again. Except by the damm subdmain that simly refuses to work.

    I was wondering if in some code's part have some root directory ling... I Don't know.... :-(

    I'm not so good in PHP to discover the problem alone... :-(

    So... Anymore suggestions?

    Thanks in advance,


  5. MichaelH
    Posted 8 years ago #

    Just so you know, this link:

    eventually takes me to:

  6. miacao
    Posted 8 years ago #

    Hi Michael!

    Thanks a lot for you attention and patience.

    Let me make myself more clear.

    English is not my native language and I have some problems to make myself clear sometimes.

    I am building an website at http://www.miacao.org . While this website is not finished yet and I have an redirect javascript to move requests from http://www.miacao.org to http://forum.miacao.org.

    It's expected. Not a problem.

    The problem is:

    I can access the blog without any problems through URL http://www.miacao.org/wp . /wp is a folder/directory at root of my hosting plan. Blog is almost ok. So I created a subdomain called miablog.miacao.org that points to that /wp directory.

    Like you must know, at WordPress main directory we do not have an index.html. We have only an index.php, that is executed when http://www.miacao.org/wp or http://miablog.miacao.org .

    With http://www.miacao.org/wp it's all ok. The blog shows without any problems.

    With http://miablog.miacao.org index.php don't do his job and redirects to http://www.miacao.org. Like I said above, that is being redirect to http://forum.miacao.org, so you finnaly goes to that url.

    I had a big and unfair fight with my hosting support. I was blamming them, telling that their subdomains system was kakked. But I was completely wrong. They did a simple test that proves to me that the real problem was the WP code. They put an index.html at WP directory and sobdomain works fine.

    So, the problem is someplace of WP code...

    When I did what you suggest before, I cannot access the blog. To access it I had to take the absolute path to wp-login.php

    And now? What can I do?


    Thanks again,


  7. moshu
    Posted 8 years ago #

    Based on what I have seen here in the forum:
    - WP never works well with this kind of "fake" subdomains. Fake in this case meaning = being redirected to another subfolder.
    - In my cPanel I can set up a subdomain without redirecting it anywhere, existing as its own entity. WP works well in it.

    Generally, using all kind of tricky redirects doesn't work well with WP, sorry.

  8. meganano
    Posted 7 years ago #

    I was preparing to move my wordpress folder from http://www.example.com/blog to megaslife.example.com and started doing research to be sure that I did it right.

    This thread leads me to believe that it can't be done, but I want to clarify before I give up. I'm adding to this thread because I believe I'm asking the same question as miacao.

    When I asked my webhost to set up the subdomain for me (I don't have cpanel or vdeck or any of that mainstream stuff) he asked if I wanted a folder within my domain that just points to the subdomain but still resides in example.com or if I wanted to set up actual separate domain (I'm sure he used some different and more correct terminology) like megaslife.example.com, which would require me to log in separately to manage that subdomain.

    I guess we opted with the first choice.

    My question is, when moving wordpress to the new folder and changing the URI in the admin > options > admin panel, couldn't I set the wordpress URI to:
    http://www.example.com/megaslife (where the wordpress folders reside)
    and the blog URI to:

    or does it make sense to set them both as megaslife.example.com?

    I'm loathe to "test it out" lest I get stuck then having to fix the entry in the database... not my forte and seemingly intimidating from the instructions if you mess up the URI entry.

  9. meganano
    Posted 7 years ago #

    Of course... the text in this page leads me to believe that what I want to do is indeed possible. Can anyone verify that this method works? I guess i could just start looking for wordpress blogs...


    "You may have created a subdomain blog.example.com, and installed WordPress into http://www.example.com/blog. Under Options, General look for the WordPress address (URI): field. Change it to read: http://www.example.com/blog. The Blog address (URI): field should still read http://blog.example.com."

Topic Closed

This topic has been closed to new replies.

About this Topic


No tags yet.