It might be weird, but i need to setup a domain for two different applications, one is built with Symfony3 whereas the other has been made with Wordpress. Both websites are on the same server.
www.example.com -> wordpress
www.example.com/custom-slug -> symfony3
is it possible to achieve this using Apache2 ?
Thanks for your help
You can use the Alias
directive to map all requests matching the pattern /custom-slug/* to the Symfony app. All other URLs will be served from wordpress.
Sample vhost:
<VirtualHost *:80>
ServerName www.example.com
ServerAdmin webmaster@localhost
DocumentRoot /your_web_root/www_example_com/wordpress/
# All URLs begining with /custom-slug will be fetched from the symfony app
Alias "/custom-slug" "/your_web_root/www_example_com/symfonyApp/web/"
<Directory /your_web_root/www_example_com/wordpress/>
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Order allow,deny
allow from all
</Directory>
<Directory /your_web_root/www_example_com/symfonyApp/web/>
AllowOverride None
Order Allow,Deny
Allow from All
<IfModule mod_rewrite.c>
Options -MultiViews
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ app.php [QSA,L]
</IfModule>
</Directory>
</VirtualHost>
Collected from the Internet
Please contact [email protected] to delete if infringement.
Comments