How to: Create a sub-domain for Mobile Oxwall

How to: Create a sub-domain for Mobile Oxwall

Hello everyone.

With the recent news of Oxwall 1.7 coming, we are certain here at EWT that there will be a lot of questions from users about Oxwall mobile. As found in the Oxwall Blog’s official post about 1.7, the mobile version of Oxwall that was released earlier this year on January 8th is now getting a new edition – Messaging. Online side this, the Private Messaging and IM plugins will be merged to be just “Messaging,” but you can read all about that in the official post.

Today, I want to share a trick with you that some users will find very useful – how to make a sub-domain such as m.mysite.com re-direct to your mobile website.

This is a simple and easy mod that shouldn’t cause damage to anything. But when modding, always make sure to be safe and follow the directions carefully and thoroughly.

  1. Make your sub-domain: You can do this from your cPanel on your host under the ‘Sub Domain’ settings. Set it to whatever you want, it can be mobile.mysite.com or just m.mysite.com. Whatever suits you. For the sake of this tutorial, we’re going with m.mysite.com
  2. Make/Edit the .htaccess file: You can go two ways with this; add a new .htaccess file to your new sub-domain folder (which is generated automatically in the main directory of public_html when you save a sub domain) or edit the already existing .htaccess that Oxwall includes. With our method, we’re going to go ahead and just add a brand new .htaccess to our now empty “m” folder.

    If you’re using a FTP from your machine (like FileZilla) you can just go and add the code from Step 3 to a .htaccess file and upload it to “m.” Elsewise, if you’re in the file manager of your host and are in the “m” directory, right-click and create a new file. Simply type in .htaccess

  3. Add the code: Now that the file is there, we need to add the .htaccess code. This code will do one simple task: re-direct the user from m.mysite.com to mysite.com/mobile-version which will, because of the way mobile Oxwall works, create a mobile session for that user, bringing them to your main mobile page. Add this code to your .htaccess file:

        RewriteCond %{HTTP_HOST} ^m.mysite.com
        RewriteRule ^(.*)$ http://mysite.com/mobile-version/$1 [R=301]

    Make sure to replace “mysite.com” with your actual domain.

  4. Now, hit save: Save the file, and then clear the cache of your website. Do it easily by installing Cache Cleaner plugin (it’s free!).

Now, test it out by typing in m.mysite.com on your device and if it takes you to the mobile version then congrats!

NOTES:
  • If the user is already in an active “mobile site” session, and they enter in the address m.mysite.com, they will be brought to an error page. This is because the redirect goes to the programmatic URL /mobile-version which isn’t an actual page on your mobile site.
  • If you don’t want to add a new .htaccess, just simply paste this code in the bottom of the .htaccess file in the main directory of your Oxwall installation.

The following two tabs change content below.
Jake Brunton is a computer science and IT student, who writes technology and gaming articles for EWTNet, and is the Head of Development and Co-founder of EWTNet.He writes poetry, sings, and enjoys anime in his free time, among other things that are modestly enjoyable.

Recieve Free Email Updates!

Leave a Reply