admin管理员组

文章数量:1327972

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
Share Improve this question asked Jul 4, 2017 at 16:14 user123146user123146 1
  • 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
Add a comment  | 

1 Answer 1

Reset to default 1

Update 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

本文标签: wp adminHow can I make Wordpress work with a Symfony app