Forum Moderators: phranque

Message Too Old, No Replies

redirect with htaccess

How to write redirect

         

Maleville

7:22 am on Feb 11, 2004 (gmt 0)

10+ Year Member



Hi every body.

I would want to redirect a folder to an other which is on an other website.

[mysite.com...] > [other.com...]

1)° How to write this in .htaccess?
2°) Where to put .htaccess file? Root or in the folder /picture/ or in /tools/?
3°) Will this affect Google or other spiders. I mean, will my page rank down as it is only pictures which are redirect?

jdMorgan

6:14 am on Feb 13, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Hi every body.

I would want to redirect a folder to an other which is on an other website.

[mysite.com...] > [other.com...]

1)° How to write this in .htaccess?

Introduction to mod_rewrite [webmasterworld.com] ;)

2°) Where to put .htaccess file? Root or in the folder /picture/ or in /tools/?

You could put it in either place. Some people like to "localize" their htaccess files for efficiency of execution, and some like to "centralize" them for efficiency of maintenance.

3°) Will this affect Google or other spiders. I mean, will my page rank down as it is only pictures which are redirect?

I doubt that it will have any effect, but who can be sure?

Jim

Maleville

4:11 pm on Feb 22, 2004 (gmt 0)

10+ Year Member



In the Apache documentation I found:
^/somepath(.*) [otherhost...] [R]

which means [otherhost...] via external redirection (the [R] flag is redundant)

In the same .htaccess in the root pass, if I write:
RewriteRule Afolder/Bfolder/(.+) [otherdomain.com...] [L]
or
RewriteRule ^iere\.zip$ [otherdomain.com...] [L]
or
redirect /Afolder [otherdomain.com...]
It works.

Which isn't working, is:
RewriteRule ^/Afolder(.*) [otherdomain.com...] [R,L]

What's wrong?

jdMorgan

7:11 pm on Feb 22, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



> What's wrong?

RewriteRule [b]^/A[/b]folder...

In .htaccess context, omit the leading slash on RewriteRule patterns, and use:

RewriteRule [b]^A[/b]folder...

Jim

Maleville

11:18 pm on Feb 22, 2004 (gmt 0)

10+ Year Member



Jim,
Unfortunatly it doesn't work.
What can I do?

jdMorgan

1:34 am on Feb 23, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Please be more specific about how it doesn't work: What does it do that it should not do, and what does it not do that it should do?

Do you get anything useful in your error log file?

Jim

Maleville

3:48 pm on Feb 26, 2004 (gmt 0)

10+ Year Member



With this:

RewriteRule ^images(.*) [myotherdomain.com...] [L]

property of an image on mydomain.com is:
[mydomaine.com...]
instead of:
[myotherdomain.com...]

BarkerJr

5:03 am on Feb 27, 2004 (gmt 0)

10+ Year Member


What's wrong with a simple redirect?

Redirect permanent /picture/tools/ http://www.other.com/picture/tool21/

Maleville

12:17 am on Mar 2, 2004 (gmt 0)

10+ Year Member



I read somewhere that "Redirect" got a bad note from Google but not with "RewriteRule" which is transparent.

In fact, I forgot to clean my I.E cache and :
RewriteRule ^images(.*) [myotherdomain.com...] [L]
is working perfectly.

Thank's for the help and sorry to forget the cache.