OSClass Sub Domain Setting

First try to install the newest osclass version. Here I use 3.6.1 version. Install it locally. It works! here is the url : http://localhost/works/osclass361. user and password for the admin page (/oc-admin/) is ‘admin’ and ‘admin’.

Setup the virtualhost

Here is the content

Then enable the website and reload Apache service using below command

Then register the above local site. open

Then type

Then restart apache

Then set the permalink for SEF url in the admin page on Show more -> Settings -> permalinks (http://localhost/works/osclass361/oc-admin/index.php?page=settings&action=permalinks) then Check ‘Enable friendly urls’ then Save Changes! It’ll create .htaccess file

Then modify config.php file. Edit these two lines

to

Test the site on your browser: http://www.osclass361.dev/ or just osclass361.dev/ Here is how it looks osclass361 Because I still have a little listing available, I need to post some of them. NOW it is time to setup the subdomain. I want to use ‘City’ as the subdomain based and use wildcard * to make it simpler. From this article Use categories, countries, regions or cities as subdomains, I’ll follow the guidelines:
1. go to admin Show More -> Settings -> Advanced (http://www.osclass361.dev/oc-admin/index.php?page=settings&action=advanced) then set:

2. Use DNS wildcard

modify from

to

3. Modify virtualhost. use *.osclass361.dev instead of www.osclass361.dev on ServerAlias

4. Restart apache

5. changes on config.php. Modify from

to

6. Add cookies configuration on config.php

7. Modify .htaccess to be like this

8. Test!

9. Open the site with the subdomain (city) like: http://abbeville.osclass361.dev/
AND IT WORKS!!! IT CAN OPEN THE OTHERS PAGES WITH THE SUBDOMAIN BUT I THINK IT NEED TO BE LIMITED WHICH PAGE CAN BE OPENED BY THE SUBDOMAIN FOR EXAMPLE ONLY FOR ITEMS PAGE AND SHOW THE ITEMS FROM THE CITY!
A FEW ERRORS ENCOUNTER:

WHEN TRYING TO ACCESS ANOTHER LINK LIKE http://www.osclass361.dev/user/login. SO IT ONLY CAN OPEN THE HOMEPAGE!
SOLUTION: It happened because I didn’t modify .htaccess file, Modify it like #7 above!
IT’S WORKS NOW BUT SLOW TO OPEN ANYPAGE (WHEN COOKIES IS ALREADY DELETED)!!!

 

Leave a Reply

Your email address will not be published. Required fields are marked *