How to hide frontend/web and backend/web COMPLETELY from url

| Last Updated: | In: Yii framework


If your only goal is to achieve not ever seeing /frontend/web or /backend/web, even without using .htaccess rules, you could go for the following. Before procees make sure your directory structure would look like :

- yii2app/
- frontend/
- backend/
- common/
- .. other folders..
- admin/
- assets/
- css/
- index.php
- assets/
- css/
- index.php

yii2-default

Your yii2app/index.php would then look like:

Go to root directory of your Yii2 application and create index.php page like : yii2aap/index.php then copy bellow code snippets and paste in your page and save it.

and your yii2app/admin/index.php would look like:

Go to admin directory of your Yii2 application and create index.php page like : yii2aap/admin/index.php then copy bellow code snippets and paste in your page and save it.

After doing above step, then go to the browser and remove frontend and backend from your browser url.

Thank you for giving time on freewebmentor community. Please don’t forget to subscribe our newsletter or join us on Facebook to be the first to learn the next great thing from freewebmentor.

Tags: , , , , ,


About: Prem Tiwari

Prem Tiwari is founder of freewebmentor.com and Software developer from New Delhi (India). Follow Prem's development codes on facebook, and make sure you check out freewebmentor.com for the latest in web development related Tips with the complete code.


You may also like:

Follow us!

Get Free Access of 350+ Scripts

Don't worry you'll not be spammed!

Featured eBook

WordPress Security Guide

Learn how to implement security guideline in your WordPress site...

DOWNLOAD

Pincode Finder

pincode-finder tool

Online Pincode Finder

Best tool to locate post Office address and pincodes of all india...

SEARCH NOW