PDA

View Full Version : 301 redirect - need help please..


Yellow Slider
09 Jul 2007, 17:31
I need to 301 redirect like that -
www.domain.com/dir/index.php

will be redirected to

www.anotherdomain.com/index.php

and all the other pages as well,
for example
www.domain.com/dir/forumdisplay.php?f=92

will 301 redircet to
www.anotherdomain.com/forumdisplay.php?f=92
and all the posts and threads as well..

thanks a lot for the help.

Dismounted
10 Jul 2007, 07:18
You should be able to create redirects using your hosting control panel (ie. cPanel, Plesk, etc.).

Yellow Slider
10 Jul 2007, 08:00
not this types of redirects.
i can do just basic redirect with my DA server panel.

Dismounted
10 Jul 2007, 08:07
What do they put into the .htaccess file?

Eikinskjaldi
10 Jul 2007, 08:24
I need to 301 redirect like that -
www.domain.com/dir/index.php

will be redirected to

www.anotherdomain.com/index.php

and all the other pages as well,
for example
www.domain.com/dir/forumdisplay.php?f=92

will 301 redircet to
www.anotherdomain.com/forumdisplay.php?f=92
and all the posts and threads as well..

thanks a lot for the help.

I haven't tested this, but try putting this into your .htaccess file



Code:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------

Yellow Slider
10 Jul 2007, 09:06
it doesn't work , at all, it isn't redirecting thanks for trying,
can you please try giving me another code to try? it's very urgent.

thanks.

Eikinskjaldi
10 Jul 2007, 09:52
it doesn't work , at all, it isn't redirecting thanks for trying,
can you please try giving me another code to try? it's very urgent.

thanks.

Nope, sorry, thats all I got. If that doesn't work, my next suggestion would be to "play around with it"


I am not sure what format .htaccess receives requests, I do all my rewriting in httpd.conf.

maybe it doesnt get the domain name?

try
RewriteRule dir/(.*) http://otherdomain.com/$1

Yellow Slider
10 Jul 2007, 12:49
I can rewrite httpd.conf, what do i need to add \ edit?

vB Nova
10 Jul 2007, 12:58
Code:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------



Have Phun :)

cyberphr
10 Jul 2007, 13:08
Don't you mean 401?

Dismounted
10 Jul 2007, 13:41
It's 301 (Permanently Moved). You're probably thinking of 404 (Page Not Found)?

Yellow Slider
10 Jul 2007, 14:13
Nope, I'm thinking on 301,
I have 2 forums, and one of then is located in a directory, i'm moving it to it's own domain (it's about time.. )

and the code isn't working (VB NOVA)
can it be because i have another htaccess file in the root folder? cous nothing had happened :

vB Nova
10 Jul 2007, 14:17
Yeah, you can merge the two files or if you don't know how/think you'll mess something up. Paste the other one here and I'll do it.

Yellow Slider
10 Jul 2007, 14:20
this is the root folder htaccess file


Code:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------




there is a board in the base domain, in a directory inside the base domain there is another board , and i want to redirect the files in the directory to a new domain (on the same server..)

thanks a lot :)

vB Nova
10 Jul 2007, 17:16
Code:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------

Yellow Slider
10 Jul 2007, 17:22
Internal Server Error
The server encountered an internal error or misconfiguration and was unable to complete your request.

:\

vB Nova
10 Jul 2007, 17:24
Code:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------




If that doesn't work try:


Code:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------

Yellow Slider
10 Jul 2007, 20:30
it redirects, but not in a good way, it lets me browse the forum like if the forum is located in the folder, instead moving me to the same path at the other domain :\

please try to help me..

vB Nova
10 Jul 2007, 20:46
What's the first domain so I can see & what code did you use, the first or the second?

Yellow Slider
10 Jul 2007, 22:48
both of them are doing the same thing,
the basic domain is
http://www.atraf-f.net
and the board that is located in http://www.atraf-f.net/upload (i've uploaded this board just to check the script) the real board is in an other directory..
it now has
RewriteRule ^upload\/(.*)$ http://www.atraf-f.net/$1

vB Nova
11 Jul 2007, 13:03
You removed the [R=301,L] :p


Code:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------

Yellow Slider
11 Jul 2007, 15:42
Thanks a lot :D !!

vB Nova
11 Jul 2007, 19:14
No Problem, Enjoy!.