Forum Moderators: phranque
Basically, i have a series of domains hosted on the one server, using htaccess and nameservers to make them do their thing.
Anywy, one of my websites, let's call it domainX.com is in need of an imode/mobile website.
The iMode content is located at domainX.com/i/
I've tried various methods of using htaccess to recirect users, including:
RewriteCond %{HTTP_USER_AGENT} "DoCoMo¦J-PHONE¦UP\.Browser¦DDIPOCKET¦ASTEL¦PDXGW¦Palmscape¦Xiino¦sharp pda browser¦Windows CE¦L-mode"
RewriteRule ^(.*)/$ /domainx/i/ [R]
But am yet to get something to work.
Please, anyone who knows anyting about this throw me a bone, i'm so frustrated getting this darn thing to work!
Cheers,
Deluxe.
Welcome to WebmasterWorld!
There's nothing wrong with what you've got there, but "it doesn't work" does not give us much to analyze in order to suggest anything. So, I'll start with the basic suggestion that you try adding an Options statement, like so:
Options +FollowSymLinks
RewriteCond %{HTTP_USER_AGENT} "DoCoMo匡-PHONE各P\.Browser刑DIPOCKET再STEL同DXGW同almscape合iino存harp pda browser名indows CE印-mode"
RewriteRule ^(.*)/?$ /domainx/i/ [R,L]
Additionally, the pattern you specified will only match if the requested URL ends with "/". Given that you're dealing with mobiles here, you may want to make that trailing slash optional, as shown.
A good place to look when you have problems is your server error log. If you are getting a 500-Server Error, it usually contains useful information.
The code as written will redirect mobile requests for any and all resources in domainx to a single page under /i. Is that really what you want?
Jim