Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

215
Views
is there any way to hide and redirect url by using rewrite rule?

[Edited] Hi There were lot of example to do similier what what i am trying to achive but it seems I am not understanding them properly, so asking for help. Please dont close this as duplicate ,

I have wordpess installed as primary website like this https://www.example.com/

apache configuration is like this

    #ServerName www.example.com
    ServerName example.com
    ServerAdmin example.com
    ServerAlias www.example.com
    DocumentRoot /var/www/html/example/web
    Header set Access-Control-Allow-Origin "*"
    SSLEngine on

    SSLCertificateFile /etc/ssl/certificate/example.com/mydomain.crt
    SSLCertificateKeyFile /etc/ssl/certificate/example.com/mydomain.key
    SSLCertificateChainFile /etc/ssl/certificate/example.com/mydomain.ca-bundle
    <Directory /var/www/html/example/web>
            AllowOverride All
            Order allow,deny
            allow from all
            #AuthType Basic
            #AuthName "Restricted Content"
            #AuthUserFile /etc/apache2/.htpasswd
            # Require valid-user </Directory>

Now i need to place 3 laravel project inside the web directory

> mydomain
>  - web (wordpress)
>    - en  ( Laravel project)
>    - bn  (laravel project)
>    - demo (laravel project)

now when i type like this it opens.as its php laravel project.

https://example.com/demo/public/
https://example.com/demo/public/home
https://example.com/demo/public/login

https://example.com/en/public/ 
https://example.com/bn/public/

However, I want to rewrite the rules such a way that when some one type

https://example.com/demo/ -> it will provide data from   https://example.com/demo/public/    but url will be https://example.come/demo
https://example.com/bn/ -> it will provide data from  https://example.com/bn/public/ but url will be https://example.com/bn

https://example.com/en/ -> it will provide data from  https://example.com/en/public/ but url will be https://example.com/en

so all the pages after /public/* will be /demo/* or /bn/* or /en/*

I have edited .httaccess under /web/demo/ with bellow ref : https://laracasts.com/discuss/channels/laravel/wordpress-and-laravel-on-subfolder?page=1

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{REQUEST_URI} !^public
RewriteRule ^(.*)$ public/$1 [L]
</IfModule>

but when i type https://example.com/demo/

its gives 404 which comming from laravel.

any help will be appreciate.

over 4 years ago · Santiago Trujillo
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!