Skip to content
Advertisement

Manage route to subfolder of PHP framework that installed WordPress

How to skip web traffic into WordPress that installed on a subfolder like /wp

I have a PHP framework at the root of my website. I use this framework: https://www.phpvibe.com/

I need to open WordPress in /wp (and all /wp/* traffic)
How can I skip my website traffic by htaccess or PHP code?

In my framework, I have a route.php file that manages my all routes and if I want to open ./wp I get a 404 error.

How can I skip the route and redirect them to the WordPress site?

Advertisement

Answer

Pretty sure you need a .htaccess file like this in your /wp subfolder

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

If might be required to add an exception to your rules int in the root if you are also using a single entry app there.

User contributions licensed under: CC BY-SA
4 People found this is helpful
Advertisement