Page 1 of 1

Incorrect URL path with multiple apache alias

Posted: 03 May 2019, 11:24
by Battamich
Hi everyone,

I recently tried to install the aimeos demo inside my server running apache2. Inside this server I have multiple laravel installations and I tried to configure them like this inside my httpd.conf:

Code: Select all

<VirtualHost *:80>
       ServerName {server_name}
       DocumentRoot /var/www/XXX/public
       Alias /XXY /var/www/XXY/public
       Alias /aimeos /var/www/aimeos/public

       <Directory /var/www/XXX>
              AllowOverride All
       </Directory>

       <Directory /var/www/XXY>
              AllowOverride All
       </Directory>

       <Directory /var/www/aimeos>
              AllowOverride All
       </Directory>

</VirtualHost>
I also modified my .htaccess file under public adding:

Code: Select all

RewriteBase /aimeos

and APP_URL in .env file:

Code: Select all

APP_URL={server_url}/aimeos
While both my other installations are working fine, both responding with correct routing:
{server_url}/XXX/products
{server_url}/XXY/products


Aimeos seems to responde correctly only when I try to get to the homepage {server_url}/aimeos/ redirecting me to {server_url}/aimeos/list.
All others routes responds like this: {server_url}/detail/15/Demo_article/0 removing my alias in the url and generating 404.

I can't understand the source of this problem.. is there any way to fix this?

Thanks in advance,
Michael

Re: Incorrect URL path with multiple apache alias

Posted: 03 May 2019, 15:51
by aimeos
Did you clear the cache (./artisan aimeos:cache)?
Does a direct call of {server_url}/aimeos/login work?

Re: Incorrect URL path with multiple apache alias

Posted: 06 May 2019, 07:36
by Battamich
I cleared artisan cache using:

Code: Select all

php artisan cache:clear
php artisan route:cache
php artisan config:cache
php artisan view:clear
The url {server_url}/aimeos/login works.

Even when I type {server_url}/aimeos/detail/15/Demo_article/0, I get the product page but I don't get redirected properly when I click the product itself from the list page.

Re: Incorrect URL path with multiple apache alias

Posted: 06 May 2019, 08:10
by aimeos
OK, that means basic routing is OK. Do other Laravel packages also show this behavior?

Re: Incorrect URL path with multiple apache alias

Posted: 06 May 2019, 09:40
by Battamich
What do you mean by other Laravel packages? Do you mean other Laravel projects? If so, routing is working fine with the other projects.

Re: Incorrect URL path with multiple apache alias

Posted: 06 May 2019, 16:57
by aimeos
How does the generated URLs look like?

Code: Select all

/detail/15/Demo_article/0
or with domain as absolute URL?

Re: Incorrect URL path with multiple apache alias

Posted: 17 May 2019, 15:17
by Battamich
I'm not sure I understood your request completely..

What I want:

Code: Select all

http://{myurl}/aimeos/detail/15/Demo_article/0
What I get:

Code: Select all

http://{myurl}/detail/15/Demo_article/0
Trying to achieve that I also add inside /public/.htaccess the following:

Code: Select all

RewriteBase /aimeos
As I did with the other ecommerce but it changed nothing.

Re: Incorrect URL path with multiple apache alias

Posted: 11 Dec 2019, 18:47
by columbo
how was this solved? I'm facing the same problem

aimeos installed in: /document_root/shop
prefix xy in shop.php:

Code: Select all

'default' => ['prefix' => 'xy', 'middleware' => ['web']],
startpage works fine: <my domain>/shop/gw

but click on a product link leads to <my domain>/gw/Product_1
instead to <my domain>/shop/gw/Product_1

how / where can I add the subdirectory /shop ?
thank you

Re: Incorrect URL path with multiple apache alias

Posted: 12 Dec 2019, 14:55
by aimeos
Laravel doesn't seem to support that:
https://github.com/aimeos/aimeos-larave ... -506869277