Basically, I have a website built that has two components. One component is the the WordPress part, under "/". And the second component is a Symfony app under "/foo". How can I make Word-press ignore the "/foo" route and redirect that to the Symfony app?
I assume that I have to use an .htaccess file to accomplish (website will run on Apache) this, but I am not too well-versed in the syntax.
Helpful Info:
- Wordpress Version 4.8 Symfony Version 3.3 Apache 2.4
Basically, I have a website built that has two components. One component is the the WordPress part, under "/". And the second component is a Symfony app under "/foo". How can I make Word-press ignore the "/foo" route and redirect that to the Symfony app?
I assume that I have to use an .htaccess file to accomplish (website will run on Apache) this, but I am not too well-versed in the syntax.
Helpful Info:
- Wordpress Version 4.8 Symfony Version 3.3 Apache 2.4
- Is my assumption right that you don't have an index.php file in your /foo directory? Maybe you add one redirecting to to app.php and it should work out of the box without any htaccess or other modifications. – chrisbergr Commented Mar 7, 2019 at 22:50
1 Answer
Reset to default 1Update your .htaccess in WordPress root folder with below code
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /foo
RewriteRule ^/foo/app\.php$ - [L]
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
# END WordPress
发布者:admin,转转请注明出处:http://www.yc00.com/questions/1742252255a4409372.html
评论列表(0条)