Forum Moderators: phranque
I host 20+ domains on my server so I use virtual hosts configured like so.
<VirtualHost www.domain.co.uk>
DocumentRoot /home/domains/domain_co_uk
ServerName www.domain.co.uk
<Directory "/home/domains/domain_co_uk">
allow from all
Options +Indexes
</Directory>
</VirtualHost>
The first thing I tried was .htaccess like so
Redirect 301 /test.html [domain.com...]
and put in the domains root directory /home/domains/domain_co_uk
I even tried to redirect the entire domain using mod_rewrite but it seems the .htaccess file is totally ignored.
Next I tried
Redirect permanent /home/domains/domain_co_uk/test.html [domain.com...]
in the httpd.conf and restarted apache as instructed.
AGAIN nothing happened.
Is my server broke or what? I hope someone reads this and can tell me what I could possibly do to solve this I have googled this problem to death and can't find anything.
Next I triedRedirect permanent /home/domains/domain_co_uk/test.html [domain.com...]
in the httpd.conf and restarted apache as instructed.
<VirtualHost www.domain.co.uk>
DocumentRoot /home/domains/domain_co_uk
ServerName www.domain.co.uk
[b] Redirect 301 /test.html http://www.otherdomain.com/test.php [/b]
<Directory "/home/domains/domain_co_uk">
allow from all
Options +Indexes
</Directory>
</VirtualHost>
Apache's instructions just say:
# Redirect allows you to tell clients about documents which used to exist in
# your server's namespace, but do not anymore. This allows you to tell the
# clients where to look for the relocated document.
# Example:
# Redirect permanent /foo http://www.example.com/bar
So based on that I just put
Redirect permanent /home/domains/domain_co_uk/test.html [domain.com...]
below there which of course didn't work.
I may seem like a total noob but all my other sites are php and a php 301 redirect is very simple.