WordPress.org

Ready to get started?Download WordPress

Forums

wordpress in a directory how do I get to it using straight domain name. (3 posts)

  1. jonathan (previously known as macmend) spencer
    Member
    Posted 7 years ago #

    my blog is at jonathanspencer.net/success

    I have put a redirect on jonathanspencer.net using cpanel to get to this.

    however this messes up any subdomains as everything get redirected to jonathanspencer.net/success that ends jonathanspencer.net.

    Is there another way to create a redirect that is search engine friendly, that will allow me to have a subdomain say gallery.jonathanspencer.net that will not redirect to /success?

  2. MichaelH
    Member
    Posted 7 years ago #

    1. In Administration > Options > General change your Blog address (URL) to http://jonathanspencer.net

    2. Add this index.php file to your web-root folder:

    <?php
    /* Short and sweet */
    define('WP_USE_THEMES', true);
    require('./success/wp-blog-header.php');
    ?>

    3. Update your permalinks via Administration > Options > Permalinks.

    Even though the actual WordPress files reside in a sub-directory, an index.php file is in your webroot, and the Options->General admin page Blog address (URL) is changed so that WordPress acts as your main page. This particular setup is described at: Giving_WordPress_Its_Own_Directory.

  3. thedesigncoalition
    Member
    Posted 6 years ago #

    I did this on my siteand it works great but I am now realizing that google is crawling the pages and giving links to the original directory, which results in a 404 since the htaccess has rewritten my urls. OH NO!

    ex.

    real location of files:
    mydomain.com/wp/index.php

    after htaccess change use urls like:
    mydomain.com/index.php

    google search result has link to:
    mydomain.com/wp/index.php
    which now returns a 404 because of htaccess

    any idea on what to do about this?

Topic Closed

This topic has been closed to new replies.

About this Topic