Reputation: 11
I tried different rules in htaccess and the solutions I found on stackoverflow doesn't work. My Problem: A Wordpress site with a specific page found under https://www.example.com/konfigurator . At this page an embedded app is loaded async by javascript. When the site gets a request under the /konfigurator e.g. /konfigurator/jeweler-finder it needs to load the app with the slug /jeweler-finder. I tried this htaccess code and it results the Wordpress 404 page.
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
RewriteBase /
# App
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^konfigurator/. /konfigurator/ [L]
#Wordpress
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
Many thanks for any suggestions on this problem!
Upvotes: 0
Views: 52
Reputation: 11
I fixed the problem. The solution was: I removed the wordpress page "konfigurator" and set a directory "/konfigurator" instead. The code for the app is placed in the /konfigurator/index.php file now. This works:
# App
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^konfigurator/. /konfigurator/ [L]
#Wordpress
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
Upvotes: 1