HELP Need to know PHP URL

Newbie Spellweaver
Joined
Jul 22, 2010
Messages
16
Reaction score
1
I have searched and searched. I want a simple peice of php on one page that uses 2 domains. Right, say my url is fnef.x10.mx and I buy a domain named fnef.com and I forward it over (so all the links work etc. fnef.com/me.php etc.).

When someone goes to fnef.com it redirects them to fnef.x10.mx but if you go to fnef.com/index.php it doesn't. I want a simple peice of PHP that checks what your url is and if it's fnef.x10.mx it will redirect u to fnef.com/index.php, Please somebody help me.

I ready somewhere it also might use .htaccess? Pleas help!! :)

Thanks in advance

PS, Fnef.com and fnef.x10.mx are not owned by me, they are just sample domains.

---------- Post added at 10:13 PM ---------- Previous post was at 10:13 PM ----------

and the url in my sig doesnt work either.
 
create a .htaccess file (no name) and put it in the webroot of fnef.x10.mx then just put this in the file:
Code:
RewriteEngine On
RewriteRule ^(.*)$ http://www.fnef.com/$1 [R=301,L]
 
create a .htaccess file (no name) and put it in the webroot of fnef.x10.mx then just put this in the file:
Code:
RewriteEngine On
RewriteRule ^(.*)$ http://www.fnef.com/$1 [R=301,L]

will it redirect it to /index.php or should i write:
Code:
RewriteEngine On
RewriteRule ^(.*)$ http://www.fnef.com/index.php$1 [R=301,L]


---------- Post added at 11:32 PM ---------- Previous post was at 10:31 PM ----------

Solvedddddddd
 
well this was wrong.. i was doing it wrong, he wanted to do it the other way im guessing cause he pmed me about the code not working and then i just told him to use this one
Code:
Redirect 301 / http://www.fnef.com/
 
Back