meta refresh alternative - not a typical one

New to mod_rewrite? This is a good place to start.

meta refresh alternative - not a typical one

Postby selytch » Sat Jul 25, 2009 1:42 am

i have a website that has several working versions.
http://badikoff.com/i
http://badikoff.com/j
and some others.

E.g /i is manual javascript+php coding, /j is a joomla version
I need to make one of them default, responding to http://badikoff.com

Now I have meta refresh in the index.php in the root dir. But it appends /j or /i and is not SEF.

I hope mod_rewrite can help, but I cannot find the answer anywhere!
selytch
 
Posts: 2
Joined: Sat Jul 25, 2009 1:37 am

Postby richardk » Sat Jul 25, 2009 2:36 pm

Try (in /.htaccess)
Code: Select all
Options +FollowSymLinks

RewriteEngine On

RewriteCond %{ENV:REDIRECT_STATUS} ^$
RewriteCond %{REQUEST_URI} !^/(i|j)(/.*)?$
RewriteRule ^(.*)$ /i/$1 [QSA,L]

/i is the default (in this case) set here: /i/$1. And all directories that should not be sent to /i are listed here: (i|j), eg. /j should not go to /i/j.
richardk
 
Posts: 8800
Joined: Wed Dec 21, 2005 7:50 am

It works!

Postby selytch » Sat Jul 25, 2009 9:20 pm

Thank you very much!
selytch
 
Posts: 2
Joined: Sat Jul 25, 2009 1:37 am


Return to Beginner's Corner

Who is online

Users browsing this forum: Google [Bot] and 30 guests

cron