Closed Thread Icon

Preserved Topic: redirect via .htaccess (Page 1 of 1) Pages that link to <a href="https://ozoneasylum.com/backlink?for=12286" title="Pages that link to Preserved Topic: redirect via .htaccess (Page 1 of 1)" rel="nofollow" >Preserved Topic: redirect via .htaccess <span class="small">(Page 1 of 1)</span>\

 
u-neek
Bipolar (III) Inmate

From: Berlin, Germany
Insane since: Jan 2001

posted posted 06-25-2002 22:48

How can i redirect from / to /test
I haven't tried it yet, but i think "redirect permanent / /test/" will work.

What about search engines? Do they follow that redirect?

mr.maX
Maniac (V) Mad Scientist

From: Belgrade, Serbia
Insane since: Sep 2000

posted posted 06-25-2002 23:24

I think that you need to specify full URL where you want to redirect (according to documentation):

Redirect permanent /one http://example.com/two

I think that most *modern* search engines will follow that redirect...


GRUMBLE
Paranoid (IV) Mad Scientist

From: Omicron Persei 8
Insane since: Oct 2000

posted posted 06-26-2002 17:18

im interested, do i have to put anything else in the htaccess file? or just this single line? cause it didnt work out for me!

Pugzly
Paranoid (IV) Inmate

From: 127.0.0.1
Insane since: Apr 2000

posted posted 06-26-2002 19:55

Actually, it should be
RedirectPermanent /one http://example.com/two

Note that there is no space between Redirect and Permanent, and Permanent is capitalized.

Put this and ONLY this (for now) in a simple text file called .htaccess, and drop it into the folder. Presto.




[This message has been edited by Pugzly (edited 06-26-2002).]

mr.maX
Maniac (V) Mad Scientist

From: Belgrade, Serbia
Insane since: Sep 2000

posted posted 06-26-2002 22:46

Nope, Pugzly, that's not completely true. RedirectPermanent is just an alias for Redirect directive, which *can* be written as I wrote above...

--- start copy/paste ---

Redirect directive
Syntax: Redirect [status] URL-path URL

If no status argument is given, the redirect will be "temporary" (HTTP status 302). This indicates to the client that the resource has moved temporarily. The status argument can be used to return other HTTP status codes:

permanent
Returns a permanent redirect status (301) indicating that the resource has moved permanently.

temp
Returns a temporary redirect status (302). This is the default.

seeother
Returns a "See Other" status (303) indicating that the resource has been replaced.

gone
Returns a "Gone" status (410) indicating that the resource has been permanently removed. When this status is used the url argument should be omitted.

Other status codes can be returned by giving the numeric status code as the value of status. If the status is between 300 and 399, the url argument must be present, otherwise it must be omitted. Note that the status must be known to the Apache code (see the function send_error_response in http_protocol.c).

--- end copy/paste ---


Pugzly
Paranoid (IV) Inmate

From: 127.0.0.1
Insane since: Apr 2000

posted posted 06-27-2002 05:20

I knew it had to be too good to be true that I would ever correct Mr. Max!

Actually, I posted it due to knowing that that would work. My mistake for saying it HAD to be that way....

GRUMBLE
Paranoid (IV) Mad Scientist

From: Omicron Persei 8
Insane since: Oct 2000

posted posted 06-27-2002 10:41

but dont you have to configure the httpd.conf to allow these kinds of directives?
im also thinking of the ErrorDocument thing from the 406-thread.

Pugzly
Paranoid (IV) Inmate

From: 127.0.0.1
Insane since: Apr 2000

posted posted 06-27-2002 14:47

It's usually enabled by default (if I recall). You shouldn't need to do anything.

« BackwardsOnwards »

Show Forum Drop Down Menu