angularjs - Apache rewrite rules for Angular site using multiple domains on same machine -


i have multiple domains point @ same machine (some subdomains), main site rendered using angularjs. have new domain www.newsite.com add in, want new domain point page on main site, i.e. http://example.co/#/newsite, there clever way apache rewrite rule? don't have html5 mode working, fixing rid of # in site urls might nice.

my current setup so:

main site:

  • located @ /var/www/html/site, web address http://example.co

    000-default.conf file:

    <virtualhost *:80>      servername example.co     serveralias www.example.co     serveradmin webmaster@localhost     documentroot /var/www/html/site  </virtualhost> 

blog site:

  • located @ /var/www/html/site/blog, web address: http://blog.example.co

    blog.conf file:

    <virtualhost *:80>     servername blog.example.co      documentroot /var/www/html/site/blog      <directory />             options followsymlinks             allowoverride none     </directory>      <directory /var/www/html/site/blog/>             options followsymlinks multiviews             allowoverride             order allow,deny             allow     </directory>  </virtualhost> 

.org site:

  • same location /var/www/html/site, web address: http://example.org

    org.conf file:

    <virtualhost *:80>     servername www.example.org     serveralias example.org      documentroot /var/www/html/site      <directory /var/www/html/site/>             options followsymlinks multiviews             allowoverride             order allow,deny             allow     </directory>  </virtualhost> 

so think need create .conf file, following:

newsite site:

  • also located @ /var/www/html/site, web address http://example.co/#/newsite

    newsite.conf file:

     <virtualhost *:80>     servername www.newexample.com     serveralias newexample.com      documentroot /var/www/html/site      <directory /var/www/html/site/>             options followsymlinks multiviews             allowoverride             order allow,deny             allow     </directory>  </virtualhost> 

and make .htaccess file main(?) site, allows traffic coming newexample.com directed http://example.co/#/newsite?

you can configuration in angular router last part of path.

just check location.host before setting otherwise redirect default of app


Comments

Popular posts from this blog

shopping cart - Page redirect not working PHP -

php - How to modify a menu to show sub-menus -

python - Installing PyDev in eclipse is failed -