Skip to content

Instantly share code, notes, and snippets.

@GromNaN
Created January 6, 2015 16:42
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save GromNaN/493b2314ec0355f10b3f to your computer and use it in GitHub Desktop.
Bridge Wordpress & Symfony
<IfModule mod_rewrite.c>
RewriteEngine On
# Symfony2 URLs begins with app or admin/dashboard
RewriteRule ^app/ app.php [QSA,L]
RewriteRule ^admin/dashboard app.php [QSA,L]
# Others requests are redirected to Wordpress
RewriteCond %{REQUEST_URI}::$1 ^(/.+)/(.*)::\2$
RewriteRule ^(.*) - [E=BASE:%1]
RewriteCond %{ENV:REDIRECT_STATUS} ^$
RewriteRule ^index\.php(/(.*)|$) %{ENV:BASE}/$2 [R=301,L]
RewriteCond %{REQUEST_FILENAME} -f [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule .? - [L]
# Rewrite all other queries to the front controller.
RewriteRule .? %{ENV:BASE}/index.php [L]
</IfModule>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment