• Resolved csie

    (@csie)


    Hello

    We have created a WordPress site in a sub directory of our main Website.

    https://www.csie.org.uk (main website)

    https://www.csie.org.uk/wordpress ( wordpress test site which we want to keep separate from our main site at them moment)

    The problem is that you cannot access the wordpress site – error message “not authorized to view this page [cfn #0004]”

    I have got as far as realising it is to do with the .htaccess code in the root directory and the line

    DirectoryIndex index.shtml

    I have read up that I need to add index.php into the root directory but still cannot completely fix this issue. If I remove this DirectoryIndex index.shtml code in .htaccess file in root directory I can open WordPress site

    Are you able to help, I know I have to place certain code in the root directory .htaccess file and the wordpress sub directory .htaccess file but just cannot work it out so that I can see both main website and WordPress site.

Viewing 3 replies - 1 through 3 (of 3 total)
  • Mayuri

    (@mayuripatel)

    1. Update .htaccess in the Root Directory

    In the root directory .htaccess file, you can modify the DirectoryIndex directive to prioritize index.php if it exists but still allow index.shtml as a fallback. Here’s how:

    DirectoryIndex index.php index.shtml

    This change allows the server to serve index.php if it exists, falling back to index.shtml if it does not.

    2. Add .htaccess to the WordPress Subdirectory (if not already present)

    In the wordpress subdirectory, make sure you have an .htaccess file configured for WordPress. Here’s the standard WordPress .htaccess content for the subdirectory:

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

    This ensures that the WordPress rewrite rules are in place for the subdirectory and should direct traffic to the appropriate pages within the wordpress folder.3. Test Your Site Access

    After making these changes:

    1. Clear any server cache (if applicable).
    2. Clear your browser cache and try accessing both your main site and the WordPress test site.
    Thread Starter csie

    (@csie)

    I think that has fixed the issue, thank you so much. I felt so close but was not sure what was going on

    Mayuri

    (@mayuripatel)

    Hey @csie

    Your most welcome ??

Viewing 3 replies - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.