0

up media my website root link

But it also works with the following link

https: // upmedia.ir/ public

What should I do to not open the site with the address / public?

my public/.htaccess codes

<IfModule mod_rewrite.c>
<IfModule mod_negotiation.c>
    Options -MultiViews -Indexes
</IfModule>

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]

# Send Requests To Front Controller...
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^ index.php [L]

my main dir .htaccess codes

RewriteEngine On
RewriteRule ^(.*)$ public/$1 [L]
</IfModule>
<IfModule lsapi_module>
  • what you can do is move your whole project except public one dir back `../` and all the contents inside public should be there in the root directory, that's how you can remove public or instead you can mark public as root in your domain.conf file. – danish-khan-I Mar 06 '21 at 09:25
  • you can set public root ex: DocumentRoot /var/www/html/yourprojectfoldername/public – Switi Mar 06 '21 at 11:49
  • I do not want to do this, do not have a better solution? – Akbar Rahmanii Mar 06 '21 at 15:51
  • Does this answer your question? [How Can I Remove “public/index.php” in the URL Generated Laravel?](https://stackoverflow.com/questions/23837933/how-can-i-remove-public-index-php-in-the-url-generated-laravel) – Pejman Kheyri Mar 07 '21 at 08:12

1 Answers1

0

Set the public folder as the root of your website.

Ion
  • 351
  • 3
  • 19