apache - .conf file to redirect naked domain to page -


i have craft cms site, has generated specific page–let's call "domain.com/page-x"–and want edit .conf file new domain redirect domain2.com straight page.

thing since it's not flat file, can't use documentroot point directly in server, i've used redirect permanent, i'm not sure if that'll work @ intended:

<virtualhost *:80>   servername domain2.com   serveralias www.domain2.com    redirect permanent / domain.com/page-x    customlog /var/log/httpd/website.lc-access.log combined   errorlog /var/log/httpd/website.lc-error.log  </virtualhost> 

is correct?

the correct way:

redirect permanent / http://domain.com/page-x/ 
  1. always include scheme (http/https)
  2. always match slashes in source , target.

Comments

Popular posts from this blog

javascript - Thinglink image not visible until browser resize -

firebird - Error "invalid transaction handle (expecting explicit transaction start)" executing script from Delphi -

mongodb - How to keep track of users making Stripe Payments -