Forum Moderators: phranque

Message Too Old, No Replies

redirecting a url

         

sepultribe

9:15 pm on Nov 25, 2004 (gmt 0)

10+ Year Member



hi. im having a problem with a redirection occuring in my website. when i go through this link [example.com...] i get redirected to sth like [example.com...] and that annoying. so i want to put a .htaccess file so that this redirection doesnt happen.

note that through this link : [example.com...] everything is ok. no redirection.

plz if anybody knows sth about this tell me

ps: i dont remember my exact apache version but i think its 1.3

[edited by: jdMorgan at 9:29 pm (utc) on Nov. 25, 2004]
[edit reason] Removed specific URLs per TOS. [/edit]

Jazeker

9:33 pm on Nov 25, 2004 (gmt 0)

10+ Year Member



Do you have rewriteRules in your server config?

sepultribe

10:41 pm on Nov 25, 2004 (gmt 0)

10+ Year Member



how can i check that?

wusin

1:50 am on Nov 26, 2004 (gmt 0)

10+ Year Member



add this in your .htaccess file:

Options +FollowSymLinks
RewriteEngine On
RewriteCond %{HTTP_HOST} ^yourdomain\.com
RewriteRule ^(.*)$ [yourdomain.com...] [R=301,L]

and make sure your server support rewrite mode.

This will redirect all visitor to www.yourdomain.com/.

Please correct me if something wrong.

sepultribe

11:07 pm on Nov 29, 2004 (gmt 0)

10+ Year Member



no thats not what i want really. the redirection i want is only from a specific url to another specific url.

in my case www.example.com/forum ~> www.example.com/forum/

jdMorgan

1:27 am on Nov 30, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Apache mod_dir will add a trailing slash to any directory-index URL which is requested without one.

I suppose you could remove mod_dir from your server's load list if you don't want that to happen, but it's a "Web standard" that directory index URLs end with a slash.

Jim