1

I have a single domain. The main application serves from a single subdomain app.domain.com. I need a simple permenant redirect to redirect users that go to app.domain.com to be redirected to newapp.domain.com. This is so that the users can update the bookmarks. This is temporary and I would like it to be at the apache level (directory level) and do not want to do this via htaccess files; e.g. I want to make this change in httpd.conf.

2 Answers 2

2

Enable mod_rewrite, if it isn't. Then, in the config for the old domain:

RewriteEngine on
RewriteRule ^.*$ http://newapp.domain.com [R]
3
  • He has written that he don't want it via .htaccess Mar 3, 2011 at 21:05
  • @Stony Rewrite rules can be used in more places than just an .htaccess file. Per here: Context: server config, virtual host, directory, .htaccess Mar 3, 2011 at 21:14
  • 1
    Very important when you use this solution don't forget the return correct Statuscode 301 moved permanently or 307 Temporary Redirect. Its very important for Search Engines that he get the correct Statuscode. In This Solution in this Post [R=301,L] or [R=307,L] Mar 3, 2011 at 21:24
3

You can try the apache2 module "mod_alias" with this you can make a permanent Redirect:

<VirtualHost *:80>
    ServerName: app.domain.com
    Redirect permanent / http://newapp.domain.com/
</VirtualHost>

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .