WordPress.org

Ready to get started?Download WordPress

Forums

How to change from localhost to localhost.local (to get wp subdomains) (13 posts)

  1. jirimenzel
    Member
    Posted 3 years ago #

    Hi, I recently got over a pretty great obstacle setting up multisites... I'd completely forgotten I had to enter the Tools submenu in order to only then start rewriting htaccess and wpconfig. Imagine spending hours upon hours because of that silly error.

    So now I find yet another obstacle. I can't get localhost to redirect to localhost.local, which is required in order to setup subdomains

    Because you are using localhost, the sites in your WordPress network must use sub-directories. Consider using localhost.localdomain if you wish to use sub-domains.

    I realise this may be more a WAMP problem than a WordPress problem, but who knows.

    I've tried modifying the DB_HOST in wp-config to localhost.local, but that's obviously not it.

    I've tried changing the hosts entry in Windows drivers etc folder from 127.0.0.1 localhost to 127.0.0.1 localhost.local.
    And that way I can get my site on localhost.local. However, whenever I try to get into my wordpress admin area it redirects to localhost. So maybe it is just a wordpress issue. Localhost.local is fine when I try to enter phpmyadmin.

  2. I realise this may be more a WAMP problem than a WordPress problem, but who knows.

    It is.

    you have to do that localhost thing in your hosts file. also widcard subdomains will not work locally. you have to manaually set all the subdomains you'll be using.

    I've tried changing the hosts entry in Windows drivers etc folder from 127.0.0.1 localhost to 127.0.0.1 localhost.local.
    And that way I can get my site on localhost.local. However, whenever I try to get into my wordpress admin area it redirects to localhost.

    Well now you have to fix the calls to localhost in the db so they say localhost.localdomain.

    (they could have said anything you put in your hosts file. Even peanut.butter, as long as it was something.something)

  3. jirimenzel
    Member
    Posted 3 years ago #

    Hey thanks for your answer. HOWEVER, the situation is as desperate as usual, only a bit worse.

    Now I finally managed to get my wordpress to install subdomains, I'm back to where I started because I'm getting:

    Internal Server Error

    The server encountered an internal error or misconfiguration and was unable to complete your request.

    Please contact the server administrator, admin@localhost and inform them of the time the error occurred, and anything you might have done that may have caused the error.

    More information about this error may be available in the server error log.

    This is the error I was getting in the thread I opened up before this one, which I thought was over since I thought the error might have been I wasn't actually installing the subdomains from within wordpress.

    So the situation is critical because this internal server error is completely incomprehensible.

    Steps I took:

    1. In order to make sure everything was on local.localdomain, I uninstalled Wampserver and installed it from scratch.

    2. Extracted WP3.05 from the RAR.

    3. Extracted it into the www file because the rules in the documentation say multisite won't work if wordpress isn't installed in the root.

    4. Therefore I installed the wordpress index.php over the default index.php that comes with Wamp, whatever it means this doesn't sound good.

    5. Left a file called testmysql among all these wordpress files, which again doesn't sound good.

    6. In phpmyadmin set up a database called 'blog'.

    7. Went to local.localdomain/wp-admin and was asked to give names to the database. Called the database the same as I'd called it in phpmyadmin, 'blog'. Called the user 'root', the host 'local.localdomain', and didn't put any password in.

    8. Added the wp allow multisite line into wp-config.

    9. Went to the Network submenu inside wordpress. Screamed horray when I saw the subdomain option available.

    10. Said to it to install.

    11. Created the blogs.dir folder inside wp-content

    12. Copied the lines in the Network menu into wp-config and .htaccess as required.

    13. I clicked on login and got the despairing horrifying message I should have been dreading but was ecstatic I'd thought I'd finally left behind.

    14. Before all this, I already had the following already enabled in windows hosts file:

    127.0.0.1 local.localdomain
    ::1 local.localdomain
    127.0.0.1 local.localdomain

  4. jirimenzel
    Member
    Posted 3 years ago #

    The key must be in the .htaccess code. Localhost just won't dig it.

    # BEGIN WordPress
    RewriteEngine On
    RewriteBase /
    RewriteRule ^index\.php$ - [L]

    # uploaded files
    RewriteRule ^files/(.+) wp-includes/ms-files.php?file=$1 [L]

    RewriteCond %{REQUEST_FILENAME} -f [OR]
    RewriteCond %{REQUEST_FILENAME} -d
    RewriteRule ^ - [L]
    RewriteRule . index.php [L]
    # END WordPress

  5. jirimenzel
    Member
    Posted 3 years ago #

    Well I went to the httpd.conf file and switched mod rewrite to override all instead of override none, the default one.

    The override that was talking about the htaccess file was already on 'all' so I doubt it mattered much.

    And no luck. It doesn't seem to be that either.

  6. 3. Extracted it into the www file because the rules in the documentation say multisite won't work if wordpress isn't installed in the root.

    *sigh* That has caveats. Locally on my machine I have multiple wordpress setups, running multisite, in folders. Not with subdomains or mapped domains. THAT is the issue.

    So, whether or not it's in the www folder is irrelevant.

    13. I clicked on login and got the despairing horrifying message I should have been dreading but was ecstatic I'd thought I'd finally left behind.

    ? Sorry, this doesn't make much sense. :)

  7. jirimenzel
    Member
    Posted 3 years ago #

    ? Sorry, this doesn't make much sense. :)

    The 500 Error I was yabberin on about :-)

    *sigh* That has caveats. Locally on my machine I have multiple wordpress setups, running multisite, in folders. Not with subdomains or mapped domains. THAT is the issue.

    So, whether or not it's in the www folder is irrelevant.

    You mean in order to get subdomains it doesn't matter if its in a subfolder as long as you've mapped the database to a subdomainish host, like local.localdomain? Well that's something, at least. It would mean if I ever got subdomains working I'd be able to have more than one wordpress working...

    Anyway, WAMP was a rivetingly complete disaster for me, for months. When it wasn't one thing it was the other. Today I switched to XAMPP, which for some reason allows me subdirectories wordpress super admin and no mention of the Internal server error so prominent in WAMP.

    But subdomains continue to be a disaster. With XAMPP it's a differently styled disaster: whenever i try to switch my host from localhost to local.localdomain, I get 'error connecting to database' from the wordpress. No matter if I try to send local.localdomain to 127.0.0.1 in the hosts file, no matter if it appears to be there, whenever I try to build a wp-config file, XAMPP or WordPress acts like if it were still sitting in localhost, as if there were some deep down code I'd have to change within the XAMPP architecture to make it realise this.

    Maybe there's a problem in the httpd files, but I wouldnt know where to start. I guess I'll have to lurch into the phpmyadmin forums in this ridiculous quest.

  8. Are you installing WP *after* you set up localhost.localdomain?

  9. jirimenzel
    Member
    Posted 3 years ago #

    You mean set it up in the hostfile? Yes. Sometimes yes, sometimes no. But mostly yes.

    It's really incomprehensible to me why localhost is still on the map even when i've replaced it with local.localdomain into the host file.

    Perhaps a key to why i fail at local.localdomain.

  10. jirimenzel
    Member
    Posted 3 years ago #

    This is what i get with xampp when i try to set it up with local.localdomain as my host.

    Error establishing a database connection

    This either means that the username and password information in your wp-config.php file is incorrect or we can't contact the database server at local.localdomain. This could mean your host's database server is down.

    * Are you sure you have the correct username and password?
    * Are you sure that you have typed the correct hostname?
    * Are you sure that the database server is running?

    If you're unsure what these terms mean you should probably contact your host. If you still need help you can always visit the WordPress Support Forums.

    Before doing this I:

    1. Restarted the PC :-)

    2. Installed XAMPP (again)

    3. Setup a database in phpmyadmin called 'blog'

    4. Setup a username in phpmyadmin called 'blogger'. Give it all the permissions possible.

    5. Extracted the wordpress 3.05 folder into the Xampp folder, like this: xampp/wordpress

    6. Tried to configure the wp config file and get the message.

  11. we can't contact the database server at local.localdomain

    your local URL is localhost.localdomain.

    Your DATABASE is at localhost.

    you're filling in the WRONG VALUE.

  12. jirimenzel
    Member
    Posted 3 years ago #

    I know localhost always works, it was local.localdomain that wasn't working and I needed it to setup the subdomains.

    How I can get my database to be only local.localdomain is beyond me.

    Anyway, the problem turned out to be the user. Apparently the database username has to be 'root'. I don't know how to configure a user like 'blogger' that will be accepted by local.localdomain. Just goes to show how much I'd know if I knew the mechanics.

    So in the unlikely event anyone out there like me chances upon this thread, and the others, that was it... after days of research...

    Now I have other issues to deal with, how to learn to transfer the sites form one domain to another.

    And more importantly, I wonder if there's any way to have more than one subdomain empire in my Xampp. It doesn't look like it. Rather it seems that because the wordpress has to be installed into the root (the htdocs) there's no space for any other domains or subdirectory installations. I hope I'm wrong.

    Thank you Andrea for your suggestions.

  13. Rather it seems that because the wordpress has to be installed into the root (the htdocs) there's no space for any other domains or subdirectory installations. I hope I'm wrong.

    like I said above, that is wrong.

    I wonder if there's any way to have more than one subdomain empire in my Xampp. It doesn't look like it.

    A multi network plugin.

    http://wordpress.org/extend/plugins/wp-multi-network/

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.