Page redirection using PHP?

Soldato
Joined
18 Oct 2002
Posts
5,832
Location
Liverpool :-)
Lo all,

i've got a domain, let's call it test.com for now with 000webhost.com. The server got hacked yesterday, it's only a test/project site for me to learn html/php etc so i deleted everything last night.

What i want is say someone sticks www.test.com into a browser, it will automatically take it to www.test.com/home.php. In the control panel for the hosting, i can't see anything to do this. At the moment it just takes them to the root of the directory with access to all the files.

Anyone got any ideas? Can i do this with PHP?

Ta :)
 
After reading about, it appears you can't just use the 301 redirect from the root to a new page. This does work, but i'm having a few problems with the images at the moment

RewriteBase /

RewriteEngine on
RewriteOptions MaxRedirects=2

# Also redirect the root folder.
RewriteCond %{HTTP_HOST} ^(www.)?test.co.uk$
RewriteRule ^(/)?$ currentsite/holding.php [L]

IndexIgnore *

This takes www.test.co.uk to www.test.co.uk/holding.php
 
Well the wierd thing is now, whatever file i put into the root or folders and then view using a browser. Avg goes mad and say's it's infected! I'm using Wamp, if i scan the WWW directory, everything is fine!

I'm just running some virus scans now, this is got me really confused just as i had it working as well
 
nothing to do with me, i suppose that's what you get with free hosting. I think i'll remove everything for now, there must be still a problem with all the sites getting hacked and redirected to the chinese website
 
Indeed, i just wanted a holding page to be up but i think i'll wait a while or possibly think about some other hosting
 
Back
Top Bottom