skip to Main Content

how to redirect laravel website using .htaccess or bootstrap file change

I have a domain www.mydm.com/folder/public but maximum url says my.mydm.com how can i tell my domain my.mydm.com to hit is equal to www.mydm.com/folder/public laravel

Wrote this

     RewriteCond %{REQUEST_FILENAME} !-d
        RewriteCond %{REQUEST_URI} (.+)/$
        RewriteRule ^ %1 [L,R=301]
    RewriteRule /assets www.mydm.com/folder/public [R=301,L]

does not help me

Any idea please guide thanks in advance

Please guide

2

Answers


  1. Can you try with this

        RewriteCond %{REQUEST_FILENAME} !-d
        RewriteCond %{REQUEST_URI} (.+)/$
        RewriteEngine On 
        RewriteRule ^$ public/index.php [L]
        RewriteRule ^((?!public/).*)$ public/$1 [L,NC]
    
    Login or Signup to reply.
  2. step 1:

    Rename File server.php INTO index.php

    step 2:

    Update .htaccess

    Options -MultiViews -Indexes
    RewriteEngine On
    
    # Handle Authorization Header
    RewriteCond %{HTTP:Authorization} .
    RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
    
    # Redirect Trailing Slashes If Not A Folder...
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond %{REQUEST_URI} (.+)/$
    RewriteRule ^ %1 [L,R=301]
    
    # Handle Front Controller...
    RewriteCond %{REQUEST_URI} !(.css|.js|.png|.jpg|.gif|robots.txt)$ [NC]
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteRule ^ index.php [L]
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_URI} !^/public/
    RewriteRule ^(css|js|images)/(.*)$ public/$1/$2 [L,NC]
    
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search