Incorrect URL path with multiple apache alias

How to configure and adapt Aimeos based shops as developer
Forum rules
Always add your Aimeos and PHP version as well as your environment (Linux/Mac/Win)
Battamich
Posts: 4
Joined: 03 May 2019, 10:54

Incorrect URL path with multiple apache alias

Post by Battamich » 03 May 2019, 11:24

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

User avatar
aimeos
Administrator
Posts: 3114
Joined: 01 Jan 1970, 00:00

Re: Incorrect URL path with multiple apache alias

Post by aimeos » 03 May 2019, 15:51

Did you clear the cache (./artisan aimeos:cache)?
Does a direct call of {server_url}/aimeos/login work?
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

Battamich
Posts: 4
Joined: 03 May 2019, 10:54

Re: Incorrect URL path with multiple apache alias

Post by Battamich » 06 May 2019, 07:36

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.

User avatar
aimeos
Administrator
Posts: 3114
Joined: 01 Jan 1970, 00:00

Re: Incorrect URL path with multiple apache alias

Post by aimeos » 06 May 2019, 08:10

OK, that means basic routing is OK. Do other Laravel packages also show this behavior?
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

Battamich
Posts: 4
Joined: 03 May 2019, 10:54

Re: Incorrect URL path with multiple apache alias

Post by Battamich » 06 May 2019, 09:40

What do you mean by other Laravel packages? Do you mean other Laravel projects? If so, routing is working fine with the other projects.

User avatar
aimeos
Administrator
Posts: 3114
Joined: 01 Jan 1970, 00:00

Re: Incorrect URL path with multiple apache alias

Post by aimeos » 06 May 2019, 16:57

How does the generated URLs look like?

Code: Select all

/detail/15/Demo_article/0
or with domain as absolute URL?
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

Battamich
Posts: 4
Joined: 03 May 2019, 10:54

Re: Incorrect URL path with multiple apache alias

Post by Battamich » 17 May 2019, 15:17

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.

Post Reply