I have to run 2 different apps on the same domain at the same time. I want to forward all requests to localhost:3000, if url contains /presscenter, if not, default should be my react.js application. I found this one here for apache virtual host:
RewriteEngine On
# Rewrite rule for /presscenter requests
RewriteCond %{REQUEST_URI} ^/presscenter [NC]
RewriteRule ^(.*)$ http://localhost:3000/$1 [P]
# Rewrite rule for all other requests
RewriteCond %{REQUEST_URI} !^/presscenter [NC]
RewriteRule ^(.*)$ /index.html [L]
but at the same time, if I want my react.js application to work properly, I also need to have this .htaccess:
RewriteEngine On
RewriteCond %{SERVER_PORT} 80
RewriteRule ^(.*)$ https://my.website.ge/$1 [R,L]
#php_value short_open_tag 1
RewriteEngine on
Options +FollowSymlinks
ErrorDocument 404 /404.php
RewriteCond %{QUERY_STRING} ^fbclid=(.*)$
RewriteRule ^pcms/? - [L]
Options -MultiViews
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^ index.html [QSA,L]
these two rules are overwriting themselves(I guess), and the website is not getting served properly. what changes should I make?