htaccess file is not working properly in Laravel on linux

41
February 11, 2019, at 12:20 PM

I'm working on a Laravel project. I'm Removing "/public" from URL but it's only work on welcome page, other page like /login,/register is doesn't work properly. it's shows an error.

The requested URL /GME/login was not found on this server.

Apache/2.4.18 (Ubuntu) Server at localhost Port 80

but when I use public/index.php in URL it's working.

http://localhost/GME/public/index.php/login

Here, is my root .htaccess file code.

<IfModule mod_rewrite.c>
RewriteEngine on
RewriteCond %{REQUEST_URI} !^public/
RewriteRule ^(.*)$ public/$1 [L] #relative substitution
RewriteRule ^ index.php

and here is my /public/.htaccess file code.

<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]
# Handle Front Controller...
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^ index.php [L]

note: i'm using linux elementary OS loki version

Answer 1

I think you need to add this to the GME directory .htaccess

RewriteEngine On
RewriteCond %{REQUEST_URI} !^public
RewriteRule ^(.*)$ public/$1 [L]
READ ALSO
Google calendar add event wrong clock

Google calendar add event wrong clock

When I add an event with start date : 2019-02-10 at 08:00 for exampleThe event in the calendar is starting the 2019-02-10 at 09:00 (with 1 hour more)

35
My question is about implementing white list gong&#39;n through PHP Quickstart

My question is about implementing white list gong'n through PHP Quickstart

I want to use PHP QuickStart with Gmail API to implement whitelist or blacklist functionsIf the sender is on the blacklist, it will be automatically spam, or only Gmail registered with the service can send letters to each other

25
WooCommerce wc_logout_url not working when using redirect url

WooCommerce wc_logout_url not working when using redirect url

I am trying to create a custom logout url using WooCommerce, the below works:

46
Automating the numbers of tags in Array of PHP

Automating the numbers of tags in Array of PHP

Each tag word has a number value at the endLike this:

14