Remove public from url

Created by Ajay Kumar Choudhary, Modified on Tue, 21 Jan, 2020 at 11:17 AM by Ajay Kumar Choudhary

Case 1


 If you have installed the worksuite on subdomain  example crm.youdomain.com and files are place in folder named as public_html/crm


Just point the subdomain directly to public folder inside crm [crm.youdomain.com-> to /public_html/crm/public]



Case 2:


If you have installed the worksuite on  domain example youdomain.com and files are placed in folder named as public_html.

Create .htaccess file and add the below content to .htaccess file. Put this place at public_html folder Ref: https://stackoverflow.com/questions/28364496/laravel-5-remove-public-from-url



<IfModule mod_rewrite.c>
    RewriteEngine On

    RewriteRule ^(.*)$ public/$1 [L]
</IfModule>



The above code works on the root public_html folder. Having said that your core laravel file should be inside the public_html folder, if your directory looks like public_html/laravelapp/public and if you put the above code inside laravelapp it won't work. Therefore you must copy all your core files into public_html and put the .htaccess file there .If you want to keep the code in a subdirectory then you can create a subdomain then this code will work for that also.

Was this article helpful?

That’s Great!

Thank you for your feedback

Sorry! We couldn't be helpful

Thank you for your feedback

Let us know how can we improve this article!

Select at least one of the reasons
CAPTCHA verification is required.

Feedback sent

We appreciate your effort and will try to fix the article