FRIHOST FORUMS SEARCH FAQ TOS BLOGS COMPETITIONS
You are invited to Log in or Register a free Frihost Account!


mod rewrite question





inphurno
Hi everyone,

On my hosting with frihost (whatsyourimpact.frih.net) I have 2 folder eng and fran for the 2 languages of our site. the 2 languages have 2 domains whatsyourimpact.eu.org (english) and votreimpact.eu.org (french), whatsyourimpact.eu.org points at the eng folder and votreimpact.eu.org points to the fran folder.

I have setup a rule like:
rewriteCond %{HTTP_HOST} ^whatsyourimpact\.frih.net [NC]
rewriteRule ^(.*)$ http://www.whatsyourimpact.eu.org/$1 [R=301,L]

to send searches for whatsyourimpact.frih.net to whatsyourimpact.eu.org but I have a new problem now. I noticed that whatsyourimpact.frih.net/eng was still working so i wanted to setup a rule to send it to whatsyourimpact.eu.org/eng.

i tried these things:

1) rewriteRule /eng/(.*) http://www.whatsyourimpact.eu.org/eng/$1 [R=301]

2) redirect 301 /eng/ http://www.whatsyourimpact.eu.org/eng/

3) redirectMatch 301 /eng/(.*) http://www.whatsyourimpact.eu.org/eng/$1

none worked so any suggestions on what i'm doing wrong here?

Thanks in advance
inphurno
i also tried something like this:

#RewriteCond %{HTTP_HOST} ^whatsyourimpact.eu.org
#RewriteCond %{REQUEST_URI} !^/fran/
#RewriteRule ^(.*)$ http://www.votreimpact.eu.org/fran/$1 [L]

but it didn't work either Sad
Stubru Freak
Is it fixed by now? It seems to work for me...
inphurno
i forgot to mention i have this at the top:

Options -Indexes
Options +FollowSymLinks
rewriteEngine on
RewriteBase /
Stubru Freak
But it works correctly now? If not, could you clearly describe the problem?
inphurno
ok let me try again, the problem is that a url like this works:
[url]
http://www.whatsyourimpact.eu.org/fran/index.html[/url]

it should not, it should redirect to http://www.votreimpact.eu.org/fran/index.html
Stubru Freak
Oh, I see.

I think this should work:

Code:

RewriteCond %{HTTP_HOST} ^whatsyourimpact.eu.org
RewriteRule ^fran/(.*)$ http://www.votreimpact.eu.org/fran/$1 [R=301,L]


RewriteCond %{HTTP_HOST} ^votreimpact.eu.org
RewriteRule ^eng/(.*)$ http://www.whatsyourimpact.eu.org/eng/$1 [R=301,L]
inphurno
Thanks Stubru Freak but i added your code and i can still open http://www.whatsyourimpact.eu.org/fran/index.php
Stubru Freak
Strange, could you post your full .htaccess file?
inphurno
Code:

Options -Indexes
Options +FollowSymLinks
rewriteEngine on

# Prevent viewing of .htaccess file
<Files .htaccess>
order allow,deny
deny from all
</Files>

#Error Documents
ErrorDocument 400 /error/badrequest.php
ErrorDocument 401 /error/authreqd.php
ErrorDocument 403 /error/forbid.php
ErrorDocument 404 /error/notfound.php
ErrorDocument 500 /error/serverr.php

# 301 redirects for old domains
rewriteCond %{HTTP_HOST} ^whatsyourimpact\.eu.org [NC]
rewriteRule ^(.*)$ http://www.whatsyourimpact.eu.org/$1 [R=301,L]

rewriteCond %{HTTP_HOST} ^whatsyourimpact\.co.nr [NC]
rewriteRule ^(.*)$ http://www.whatsyourimpact.eu.org/$1 [R=301,L]

rewriteCond %{HTTP_HOST} ^whatsyourimpact\.co.cc [NC]
rewriteRule ^(.*)$ http://www.whatsyourimpact.eu.org/$1 [R=301,L]

rewriteCond %{HTTP_HOST} ^whatsyourimpact\.frih.net [NC]
rewriteRule ^(.*)$ http://www.whatsyourimpact.eu.org/$1 [R=301,L]

rewriteCond %{HTTP_HOST} ^votreimpact\.eu.org [NC]
rewriteRule ^(.*)$ http://www.votreimpact.eu.org/$1 [R=301,L]

RewriteCond %{HTTP_HOST} ^whatsyourimpact.eu.org
RewriteRule ^fran/(.*)$ http://www.votreimpact.eu.org/fran/$1 [R=301,L]

RewriteCond %{HTTP_HOST} ^votreimpact.eu.org
RewriteRule ^eng/(.*)$ http://www.whatsyourimpact.eu.org/eng/$1 [R=301,L]

#this stops screen flicker in IE6
BrowserMatch "MSIE" brokenvary=1
BrowserMatch "Mozilla/4.[0-9]{2}" brokenvary=1
BrowserMatch "Opera" !brokenvary
SetEnvIf brokenvary 1 force-no-vary

ExpiresActive On
ExpiresDefault A18000
ExpiresByType image/gif A604800
ExpiresByType image/jpeg A604800
ExpiresByType image/png A604800


i have also many Redirect 301 for moved or renamed content but this should not affect the problem
Related topics
mod_rewrite
Mod Rewrite!!
Hello
search engine friendly ??
How to use mod rewrite?
Does mod rewrite nescessary?
Appache Mod Rewrite
url rewrite
mod rewrite - danger?
Help needed with mod rewrite
Mod rewrite subdomain
hi just want to ask something..
another mod rewrite question
Question concerning warnings?
Reply to topic    Frihost Forum Index -> Scripting -> Others

FRIHOST HOME | FAQ | TOS | ABOUT US | CONTACT US | SITE MAP
© 2005-2011 Frihost, forums powered by phpBB.