WordPress inside October folder

Hi! I need to run WordPress inside October folder but I can’t make it work.

Eg.:
example .com - October
example .com/wordpress/ - WordPress

My htaccess:

<IfModule mod_rewrite.c>

    <IfModule mod_negotiation.c>
        Options -MultiViews
    </IfModule>
        
    <IfModule mod_expires.c>
        ExpiresActive On
        ExpiresDefault "access plus 10 days"
        ExpiresByType text/css "access plus 1 month"
    </IfModule>

    RewriteEngine On

    ##
    ## Uncomment following lines to force HTTPS.
    ##
    RewriteCond %{HTTPS} off
    RewriteRule (.*) https://%{SERVER_NAME}/$1 [L,R=301]

    ##
    ## Blocked folders
    ##
    RewriteRule ^bootstrap/.* index.php [L,NC]
    RewriteRule ^config/.* index.php [L,NC]
    RewriteRule ^vendor/.* index.php [L,NC]
    RewriteRule ^storage/cms/.* index.php [L,NC]
    RewriteRule ^storage/logs/.* index.php [L,NC]
    RewriteRule ^storage/framework/.* index.php [L,NC]
    RewriteRule ^storage/temp/protected/.* index.php [L,NC]
    RewriteRule ^storage/app/uploads/protected/.* index.php [L,NC]


    ##
    ## Allowed folders
    ##
    RewriteCond %{REQUEST_FILENAME} -f
    RewriteCond %{REQUEST_FILENAME} !/.well-known/*
    RewriteCond %{REQUEST_FILENAME} !/app/(assets|resources)/.*
    RewriteCond %{REQUEST_FILENAME} !/virtual/.*
    RewriteCond %{REQUEST_FILENAME} !/storage/app/media/.*
    RewriteCond %{REQUEST_FILENAME} !/storage/app/resources/.*
    RewriteCond %{REQUEST_FILENAME} !/storage/app/uploads/public/.*
    RewriteCond %{REQUEST_FILENAME} !/storage/temp/public/.*
    RewriteCond %{REQUEST_FILENAME} !/themes/.*/(assets|resources)/.*
    RewriteCond %{REQUEST_FILENAME} !/themes/.*/(svg|resources)/.*
    RewriteCond %{REQUEST_FILENAME} !/plugins/.*/(assets|resources)/.*
    RewriteCond %{REQUEST_FILENAME} !/modules/.*/(assets|resources)/.*
    RewriteCond %{REQUEST_FILENAME} !/robots.txt/*
    RewriteCond %{REQUEST_FILENAME} !/wordpress/.*
    RewriteRule !^index.php index.php [L,NC]

    ##
    ## Block all PHP files, except index
    ##
    RewriteCond %{REQUEST_FILENAME} -f
    RewriteCond %{REQUEST_FILENAME} \.php$
    RewriteRule !^index.php index.php [L,NC]

    ##
    ## Standard routes
    ##
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteRule ^ index.php [L]

</IfModule>

Best scenario would be to make WP available on a subdomain, e. g. wp.example.com, and create a virtual host / block for this subdomain. This way you can have completely separate configurations.
You could then still make WP available through a “subdirectory” slug on your main domain, that would get rewritten to the subdomain through mod_rewrite.

If you need to run WP in a subfolder, you’ll need to create an alias in your virtual host / block configuration, that points to the WP folder. The WP should be inside the document root of your main site. In case of OCMS, your document root should be on the public directory, where you would create a symlink to your wordpress installation in the root folder.

There are a few more details to consider, but this should be the best way to go.

1 Like