简体   繁体   中英

drupal internal redirect

I have a drupal 6 installation that runs multi sites.

I have a sub domain uk.example.com which now needs to be accessible to everyone as www.example.com, by running an internal redirect, so that the URL in the browser always reads www.example.com/somepage not uk.example.com/somepage.

Can anyone tell me the best way to go about this? Is there a drupal module or is it best to do this with .htaccess - if .htaccess can someone help with the required code please?

Inside the if statement "" of your .htaccess just put this

# if domain is not www.example.com redirect to it 
  RewriteCond %{HTTP_HOST} !^www.example.com [NC]
  RewriteRule ^(.*)$ http://www.example.com.com/$1 [R=301,L]

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM