configure the wordpress .htaccess file so that it only accepts me in the url domain.com/blog

Viewed 30

I have a site made in react.js and we need a blog session in wordpress.

domain.com

site in react.js

our must be on this route;

domain.com/blog

site in wodpress

we are using docker wodpress-apache

# BEGIN WordPress
RewriteEngine On
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
# END WordPre

this is the file that is generated using docker

when I use /blog it will load my wordpress site ?

everything from /blog belongs to wordpress in the .htaccess ?

using nginx we solved it this way. but the cabinet wants it with apache2

location ^~ /blog {
    alias /var/www/html;
    ....
}
1 Answers

On Apache, you can do so using reverse proxy and rewrite rules. First you need to create an external application . Think of it as similar to the alias you defined in nginx. Then add a rewrite rule to send traffic to the proxy external application you created. It'll look like

REWRITERULE ^(.*)$ HTTP://apache:8080/$1 [P] (apache being your external application)

You may find this helpful: https://openlitespeed.org/kb/reverse-proxy-basics/

Related