Forum Moderators: phranque
I have the mod_rewrite enabled with
LoadModule rewrite_module modules/mod_rewrite.so
I have the following code in my .htaccess.
Options +FollowSymLinks
RewriteEngine On
RewriteBase /
RewriteCond %{HTTP_HOST} ^events\.mydomain\.com [NC]
RewriteRule ^(.*)$ [new-domain.net...] [R=301,L]
Additional info:
Web server: Windows Server 2008
Apache 2.2.13
Joomla 1.5.15
events.mydomain.com and our main Joomla website (www.mydomain.com) have different IP addresses.
events.mudomain.com is now defunct and we cannot afford to keep it up on the server. We need to make room for something else. So, I have to find a way to redirect all requests for events.mydomain.com (which is most likely triggered by bookmarks) to the new site address of www.new-domain.net. Any insights would be greatly appreciated. Thank you.
[Tue Jan 12 07:53:27 2010] [notice] Parent: Received shutdown signal -- Shutting down the server.
[Tue Jan 12 07:53:27 2010] [notice] Child 2324: Exit event signaled. Child process is ending.
[Tue Jan 12 07:53:28 2010] [notice] Child 2324: Released the start mutex
[Tue Jan 12 07:53:29 2010] [notice] Child 2324: All worker threads have exited.
[Tue Jan 12 07:53:29 2010] [notice] Child 2324: Child process is exiting
[Tue Jan 12 07:53:29 2010] [notice] Parent: Child process exited successfully.
[Tue Jan 12 07:53:29 2010] [notice] Apache/2.2.13 (Win32) configured -- resuming normal operations
[Tue Jan 12 07:53:29 2010] [notice] Server built: Aug 6 2009 15:50:50
[Tue Jan 12 07:53:29 2010] [notice] Parent: Created child process 2904
[Tue Jan 12 07:53:30 2010] [notice] Child 2904: Child process is running
[Tue Jan 12 07:53:30 2010] [notice] Child 2904: Acquired the start mutex.
[Tue Jan 12 07:53:30 2010] [notice] Child 2904: Starting 64 worker threads.
[Tue Jan 12 07:53:30 2010] [notice] Child 2904: Starting thread to listen on port 80.
You'll need a "A record" in the DNS zone file for the server, defining the IP address to which requests for "events.example.com." are to be routed. This should be the server that you're putting your redirect code on.
The next step is to be sure that the server to which the requests are routed will recognize requests for the "events" subdomain. If it isn't defined, you'll likely see 404 Errors in the browser, but nothing in the server logs, because the server doesn't know which host it should log the error on.
In order to do this redirect, you have to 'host' the old domain somewhere -- whether or not there are actually any 'pages' on the server.
So it sound like maybe you've jumped straight to coding, but don't have a host configured to accept the requests for the old site and run the redirect code.
Jim