• Resolved Footbag

    (@footbag)


    I just finished setting up a new website, and I had the new site in the https://www.lackawannaastonomicalsociety.org/LAS/ folder. The old site is in the root domain.

    I was planning on just using redirect in Cpanel, but I’m getting a redirect error. I tried the opposite and have no problems redirecting form the new folder back to the old site. Am I doing something wrong?

    What I want is all of the traffic going to https://www.lackawannaastronomicalsociety.org to go to the /LAS/ folder.

    This is what Cpanel wrote in the .htaccess file. Does that look right?

    RewriteCond %{HTTP_HOST} ^.*$
    RewriteRule ^LAS\/?$ “http\:\/\/lackawannaastronomicalsociety\.org\/” [R=301,L]

    Thanks in advance.

Viewing 6 replies - 1 through 6 (of 6 total)
  • Thread Starter Footbag

    (@footbag)

    Can’t I just use Cpanel Redirect to forward all traffic to the folder rather then moving the blog?

    That’s what I’m attempting to do, but I’m thinking Cpanel is messing up the .htaccess file.

    Thread Starter Footbag

    (@footbag)

    Ok, I’m pretty much stumped. I’ve been using every snippet of code I could find, but it’s not working.

    A few things I’m wondering is does it matter that the old site is .html and the new is not? Do I need to remove the old .html file from the root directory for this to work?

    One site shows with a www and one doesn’t does that matter?

    Don’t worry about www v.s. no www.

    I strongly advise against using cPanel Redirect. It takes a little concentration to determine what you need to do from the codex article that esmi quotes, but I just summarized it on a Web page I’m building for myself and my business partners:
    (1) From WordPress Admin, select Settings – Reading – Front page displays – A static page – Front page – select the WordPress Page that you want to be your site’s Home Page
    (2) Click Save Changes button
    (3) From WordPress Admin, select Settings – General – Blog address (URL) – correct the value to be just the domain name, e.g. – https://www.mysite.com
    (4) Click Save Changes button
    (5) If you already have an .htaccess file in the Root Directory, and it contains something more than just comments, you will have to merge its contents in the next step, rather than merely copying the .htaccess file found in the WordPress subdirectory
    (6) Copy the .htaccess and index.php files from the WordPress subdirectory to the Root Directory
    (7) Edit the Root Directory’s copy of the index.php file:
    (7.1)find require(’./wp-blog-header.php’);
    (7.2)insert the WordPress subdirectory
    (7.3)for example, if wp is the name of subdirectory, require(’./wordpress/wp-blog-header.php’);
    (8) If you have an index.html file, delete it or rename it to oldindex.html

    The codex article is still worth reading, as it covers things that might effect you, but didn’t me.

    On my server index.php seems to have priority over index.html but still I renamed it.
    If people have this index.html hard coded as a link or as a favourite my index.php in my theme brings me to the standard error notice which is fine by me.
    That index.php looks like this”

    <?php if (have_posts()) : ?>
    ....
    ....
    <code><?php else : ?></code>
    
    <code><h2>Error</h2></code>
    <code><p>Something went wrong. Please try the menu on the left.</p></code>
    
    <?php endif; ?>

    Thread Starter Footbag

    (@footbag)

    Thanks guy’s. That did it. I hadn’t moved the index.php file to the root and I think that was my problem. It also could’ve been giving priority to the index.html file.

    Did both and it works perfectly just in time to launch it at our club meeting.

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Redirect to blog folder?’ is closed to new replies.