icon Get the most out of Surmunity, read our tips here! Need an interesting blog to read? You've got to read the Surpass Blog! | Welcome! Please register to access all of our features.
Old February 28th, 2007, 11:56 PM   #1 (permalink)
Registered User
Fresh Surpasser
 
Joined in Feb 2007
2 posts
Gave thanks: 0
Thanked 0 times
Mobile Web Server

I would like to host two versions of my website on a single domain (www.direk.jp). The main page for PCs and a simple xhtml mp page for mobile phones. How do I direct the mobiles to the approproate page. I have check out mime and browser detection, but i cant understand actually what to do. Maybe .htaccess?? Thank you for your help.

James
ferrerjr is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old March 1st, 2007, 12:33 AM   #2 (permalink)
He shoots.. He scores!
Super #1
 
puckchaser's Avatar
 
Joined in Feb 2007
Lives in A room with no windows.
Hosted on SH110
1,449 posts
Gave thanks: 46
Thanked 140 times
You should be able to do with htaccess

Quote:
Example:

To rewrite the Homepage of a site according to the ``User-Agent:'' header of the request, you can use the following:


RewriteCond %{HTTP_USER_AGENT} ^Mozilla.*
RewriteRule ^/$ /homepage.max.html [L]

RewriteCond %{HTTP_USER_AGENT} ^Lynx.*
RewriteRule ^/$ /homepage.min.html [L]

RewriteRule ^/$ /homepage.std.html [L]

Interpretation: If you use Netscape Navigator as your browser (which identifies itself as 'Mozilla'), then you get the max homepage, which includes Frames, etc. If you use the Lynx browser (which is Terminal-based), then you get the min homepage, which contains no images, no tables, etc. If you use any other browser you get the standard homepage.
Here's the source: http://httpd.apache.org/docs/1.3/mod/mod_rewrite.html

Good luck.

PC
__________________
SH110
puckchaser is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old March 1st, 2007, 12:44 AM   #3 (permalink)
Registered User
Fresh Surpasser
 
Joined in Feb 2007
2 posts
Gave thanks: 0
Thanked 0 times
Thanks

Thank you, ill try that now. Do i need to know anything very specific to edit .htaccess. I have never done it before? Thanks again
ferrerjr is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old March 1st, 2007, 12:52 AM   #4 (permalink)
He shoots.. He scores!
Super #1
 
puckchaser's Avatar
 
Joined in Feb 2007
Lives in A room with no windows.
Hosted on SH110
1,449 posts
Gave thanks: 46
Thanked 140 times
I would suggest editing in something like notepad or other similar ASCII editor.

OR

You could use this neato htaccess generator.

http://cooletips.de/htaccess/

There is even a block for rewrite based on browser... Generate and put it in the htdoc root folder.



PC.
__________________
SH110
puckchaser is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On