Set up front-end shop without '/public' in url
Forum rules
Always add your Laravel, Aimeos and PHP version as well as your environment (Linux/Mac/Win)
Spam and unrelated posts will be removed immediately!
Always add your Laravel, Aimeos and PHP version as well as your environment (Linux/Mac/Win)
Spam and unrelated posts will be removed immediately!
-
- Expert
- Posts: 274
- Joined: 27 Jun 2019, 16:19
Set up front-end shop without '/public' in url
Hi guys!
My environment is the following:
Laravel Framework 5.8.26
aimeos-laravel 2019.07
PHP Version 7.2.19-1+ubuntu18.04.1+deb.sury.org+1
I am trying to set up front-end shop.
/var/www/schmuck/resources/views/app.blade.php :
/var/www/schmuck/routes/web.php :
But the /shop page looks like https://prnt.sc/ojdqis
It is because I removed 'public' from url (rename server to index and customize htaccess)
/var/www/schmuck/.htaccess :
As I see js scripts and other resources are not loaded, it tries to get it by http://schmuck/packages/aimeos/shop/the ... aimeos.css
What should I do ? Edit htaccess ?
I hope maybe I can set correct path somewhere in Aimeos config ?
My environment is the following:
Laravel Framework 5.8.26
aimeos-laravel 2019.07
PHP Version 7.2.19-1+ubuntu18.04.1+deb.sury.org+1
I am trying to set up front-end shop.
/var/www/schmuck/resources/views/app.blade.php :
Code: Select all
<!DOCTYPE html>
<html lang="en" class="no-js">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
@yield('aimeos_header')
<title>Aimeos on Laravel</title>
<link type="text/css" rel="stylesheet" href='https://fonts.googleapis.com/css?family=Roboto:400,300'>
<link type="text/css" rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
@yield('aimeos_styles')
</head>
<body>
<nav class="navbar navbar-default">
<div class="container-fluid">
<div class="navbar-header">
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1">
<span class="sr-only">Toggle Navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="#">Laravel</a>
</div>
<div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
<ul class="nav navbar-nav">
<li><a href="/">Home</a></li>
</ul>
<div class="nav navbar-nav navbar-right">
@yield('aimeos_head')
</div>
</div>
</div>
</nav>
<div class="col-xs-12">
@yield('aimeos_nav')
@yield('aimeos_stage')
@yield('aimeos_body')
@yield('aimeos_aside')
@yield('content')
</div>
<!-- Scripts -->
<script type="text/javascript" src="https://code.jquery.com/jquery-3.1.1.min.js"></script>
<script type="text/javascript" src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
@yield('aimeos_scripts')
</body>
</html>
Code: Select all
Route::get('/', function () {
return view('app');
});
It is because I removed 'public' from url (rename server to index and customize htaccess)
/var/www/schmuck/.htaccess :
Code: Select all
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]
What should I do ? Edit htaccess ?
I hope maybe I can set correct path somewhere in Aimeos config ?
Re: Set up front-end shop without '/public' in url
Your Larave ./public/ directory must be the document root of your domain - esp. for security reasons!
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, give us a star
If you like Aimeos, give us a star
-
- Expert
- Posts: 274
- Joined: 27 Jun 2019, 16:19
Re: Set up front-end shop without '/public' in url
I have changed it safety. A lot of people remove that /public from url because it is ugly.
IT is worry that nobody can tell me how to solve the problem ?
IT is worry that nobody can tell me how to solve the problem ?
Re: Set up front-end shop without '/public' in url
Your Laravel ./public/ directory must be the document root of your domain. Set up your web server accordingly
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, give us a star
If you like Aimeos, give us a star
-
- Expert
- Posts: 274
- Joined: 27 Jun 2019, 16:19
Re: Set up front-end shop without '/public' in url
Aaah, I understand ! Sorry, yesterday I was stupid a little bit )) So when I set public as document root then I will not have public in url and it will work. I have done it another way, you variant sure better!
-
- Expert
- Posts: 274
- Joined: 27 Jun 2019, 16:19
Re: Set up front-end shop without '/public' in url
Can you, please, explain why do I have this on /shop page ?
No catalog node for ID ""
https://prnt.sc/ojrtjz
I would like have like this:
http://laravel.demo.aimeos.org/default/en/EUR/list
No catalog node for ID ""
https://prnt.sc/ojrtjz
I would like have like this:
http://laravel.demo.aimeos.org/default/en/EUR/list
-
- Expert
- Posts: 274
- Joined: 27 Jun 2019, 16:19
Re: Set up front-end shop without '/public' in url
I have fixed it just by adding demo data by executing , but footer is missing( What might be the reason ? Or the footer is just missing in template here https://github.com/aimeos/aimeos-laravel ?
Code: Select all
php artisan aimeos:setup --option=setup/default/demo:1
-
- Expert
- Posts: 274
- Joined: 27 Jun 2019, 16:19
Re: Set up front-end shop without '/public' in url
Ok, now I am caring about how to remove '/shop' from url, or, I mean how to make application shows '/shop' content on '/' page ? So I want to show on my root / page the content from /shop
-
- Expert
- Posts: 274
- Joined: 27 Jun 2019, 16:19
Re: Set up front-end shop without '/public' in url
Nice, I have done it by adding the following code to my routes/web.php :
Code: Select all
Route::get('/', array(
'as' => 'aimeos_shop_list',
'uses' => '\Aimeos\Shop\Controller\CatalogController@listAction'
));