redirect with .htacess

moltes

New Member
Messages
74
Reaction score
0
Points
0
hi,

I'm writing this post because something strange happen.

I'm using this .htacess code for one of my website:
Code:
RewriteEngine on
Options +FollowSymlinks
 
RewriteCond %{HTTP_HOST} ^domain\.net$
RewriteRule ^(.*)$ http://www.domain.net/$1 [QSA,R=301]
 
RewriteRule ^$ /fr [L]

It's used to redirect domain.net to http://forums.x10hosting.com/programming-help/www.domain.net

when I go to domain.net, it redirects to www.domain.net/fr
when I go to domain.net/en, it redirects to www.domain.net/en
but
when I go to domain.net/fr, it doesn't redirect (I'm still on domain.net/fr)

if I delete the last line, it's still doesn't redirect domain.net/fr.

I don't know why... have you an idea?

Edit:

any idea ?
 
Last edited:

woiwky

New Member
Messages
390
Reaction score
0
Points
0
Is there any more to that .htaccess file? Or are there any .htaccess files in a parent directory? Also, if /fr is a real directory, is there a .htaccess in there? I don't see anything wrong with the rewrites you showed, I've even used the same ones myself. The only thing I can think of is that another rule somewhere is conflicting with it.
 

moltes

New Member
Messages
74
Reaction score
0
Points
0
the code I've written is complete and there is apparently no other htaccess file which could conflict with that one...
I really don't know what happen...
but it's not essential, so I'll do with that...

thank you woiwky :)
 
Last edited:

misson

Community Paragon
Community Support
Messages
2,572
Reaction score
72
Points
48
It's a longshot, but might content negotiation be causing problems?
 

woiwky

New Member
Messages
390
Reaction score
0
Points
0
The same thing crossed my mind, but I can't see why he would be using these rewrite rules if he's already using content negotiation. He also said he has no more .htaccess files, so unless he has access to the httpd.conf file(if he's on a vps), I don't think he can define anything for content negotiation.

It really is very strange behavior. Perhaps he does have access to the httpd.conf file and he forgot about something he changed in there.
 
Top