• I got a running wp blog on https://www.mydomain.com
    How to configure a new wp installation on subdomain.mydomain.com ?

    Right now anytext.mydomain.com is redirected to mydomain.com

    I guess i have to chane something in .htaccess / wp-config ?

    Thanks!

Viewing 10 replies - 1 through 10 (of 10 total)
  • What have you done so far with the new WordPress install, and what exactly is going wrong with the it? Have you installed WordPress on the subdomain but it’s just not visible?

    If you just need to stop it from redirecting, you should be able to do that by reconfiguring your subdomain on your domain provider’s control panel (They can tell you how to do this.) or modify your .htaccess file depending on how it was originally setup to redirect.

    Thread Starter margje

    (@margje)

    Thanks for passing by Eric,

    I’ve created a subdomain (cpanel) installed wp on that subdomain but:

    https://subdomain.mydomain.com

    is going to

    https://www.mydomain.com (also a wp installation)

    Run these queries in database.
    UPDATE wp_options SET option_value = replace(option_value, ‘https://www.oldsiteurl.com’, ‘https://www.newsiteurl.com’) WHERE option_name = ‘home’ OR option_name = ‘siteurl’;

    UPDATE wp_posts SET guid = REPLACE (guid, ‘https://www.oldsiteurl.com’, ‘https://www.newsiteurl.com’);

    UPDATE wp_posts SET post_content = REPLACE (post_content, ‘https://www.oldsiteurl.com’, ‘https://www.newsiteurl.com’);

    Before you run any queries, make sure to do a full backup of the subdomain’s WordPress install (including the database and your site’s content). You can follow this tutorial to setup your backups.

    Thread Starter margje

    (@margje)

    Thanks for the support so far…

    I’m sorry, i was not clear enough.

    I want to KEEP the existing WP installation in the ROOT
    I want to ADD a NEW WP installation on a subdomain

    The problem is when I enter the subdomain, it REDIRECT to the root.
    I guess it’s a simple line somewhere (.htaccess) ??

    Have you done anything beyond adding a subdomain in cPanel? What have you done, step by step, with the new subdomain? Have you installed WordPress, and if you did, was it a fresh copy of WordPress?

    Thread Starter margje

    (@margje)

    Hi Eric,

    1. I created a subdomain in cpanel
    2. I made a fresh wp install in that subdomain

    Okay, thanks. Could you post the contents of your .htaccess file?

    Thread Starter margje

    (@margje)

    Sorry for the delay …

    Below you can find my .htaccess data

    Options All -Indexes

    RewriteEngine On
    RewriteCond %{HTTP_HOST} !^www\.
    RewriteRule ^(.*)$ https://www.%{HTTP_HOST}/$1 [R=301,L]

    <IfModule mod_deflate.c>
    AddOutputFilterByType DEFLATE text/html text/xml text/css text/plain
    AddOutputFilterByType DEFLATE image/svg+xml application/xhtml+xml application/xml
    AddOutputFilterByType DEFLATE application/rdf+xml application/rss+xml application/atom+xml
    AddOutputFilterByType DEFLATE text/javascript application/javascript application/x-javascript
    AddOutputFilterByType DEFLATE application/x-font-ttf application/x-font-otf
    AddOutputFilterByType DEFLATE font/truetype font/opentype
    </IfModule>

    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /
    RewriteRule ^index\.php$ – [L]
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /index.php [L]
    </IfModule>

    Okay, now rename your .htaccess file to something else such as .htaccess.old. Then, log in to WordPress on your new subdomain and resave your permalink settings (Settings -> Permalinks). WordPress will then recreate your .htaccess file.

    Hopefully this will fix your issue! If not, please post the contents of the new .htaccess file that WordPress regenerated.

Viewing 10 replies - 1 through 10 (of 10 total)
  • The topic ‘add new installation on subdomain beside existing wp installation’ is closed to new replies.