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 the founder of freewebmentor.com and is a professional developer who has vast experience in PHP and open source technologies. Apart from this, he is a blogger by hobby.


You may also like:

Get Free Access of 450+ Scripts

Don't worry you'll not be spammed!

Featured eBook

WordPress Security Guide

Free Guide: Learn how to implement security guideline in your WordPress site...

DOWNLOAD

Free WordPress Setup Service

Free WordPress Setup

Want to Setup WordPress Blog Setup? I will help you in the setup of your WordPress blog.

Click Here

Pincode Finder

pincode-finder tool

Online Pincode Finder

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

SEARCH NOW