How can i use Aimeos Laravel package Routes as localhost Routes in Laravel 5.4? - laravel-routing

When i run the package from IP that is generated by php artisan serve command, its run easily. It I another icon of the site then it can not find valid route. As example some images is attached.
http://localhost/ecomerce/public/list.
After clicking the image the valid url does not show and return error like this image
and URL is "http://localhost/detail/4/Demo_selection_article/1" that is my problem.
If I rewrite the URL as http://localhost/ecomerce/public/detail/4/Demo_selection_article/1 then work well.
The package I use that link is https://github.com/aimeos/aimeos-laravel.
How can I solve this problem? Pleas help me.

The Laravel router expects that ./public/ is your document root, so your problem isn't related to Aimeos if I'm correct but is a common Laravel problem.

Related

Vue js routes mode history not working when deploy to sub directory

I am using vue cli version 2.9.6. I want to deploy to sub directory on shared hosting.
I was followed instruction from http://www.matjazev.net/blog/2018/03/01/using-vue-spa-created-with-webpack-in-subfolder/ and it work fine when using hash mode routes.
But if using history, there is a problem. The problem is when I access http://example.com/subdirectory/user for example, there is an error "The requested URL was not found on this server.".
But if I access http://example.com/subdirectory it works.
What is the problem?
Thanks in advance. Sorry my english is very poor.

Securing GitLab Pages with Let's Encrypt gets 404

I am following this tutorial https://about.gitlab.com/2016/04/11/tutorial-securing-your-gitlab-pages-with-tls-and-letsencrypt/
Next step instructions are:
Make sure your web server displays the following content at
http://YOURDOMAIN.org/.well-known/acme-challenge/5TBu788fW0tQ5EOwZMdu1Gv3e9C33gxjV58hVtWTbDM
before continuing:
5TBu788fW0tQ5EOwZMdu1Gv3e9C33gxjV58hVtWTbDM.ewlbSYgvIxVOqiP1lD2zeDKWBGEZMRfO_4kJyLRP_4U
#
# output omitted
#
Press ENTER to continue
According to the tutorial, it's using Jekyll, but I don't use a static html generator like jekyll. The files are all static html. I created the exact path under root folder: /.well-known/acme-challenge/PukY0bbiH3nRfciQ4IzwTDIXFn4G5sZ5I-LkMz3-KHE.html
But after the piplines jobs are done, I am still getting 404. What's the problem here?
I had problem same yesterday and I found the solution, I hope it is not too late to share with you. According to this tutorial here, the "well-known" folder should be under the "public" folder.
And the letsencrypt need to access a .html file in the following path using the browser.
http://YOURDOMAIN.org/.well-known/acme-challenge/5TBu788fW0tQ5EOwZMdu1Gv3e9C33gxjV58hVtWTbDM
To do this, you must create the "index.html" file in the path below inside your gitlab repository.
public/.well-known/acme-challenge/5TBu788fW0tQ5EOwZMdu1Gv3e9C33gxjV58hVtWTbDM/index.html
In the "index.html" file you should put only the following sentence:
5TBu788fW0tQ5EOwZMdu1Gv3e9C33gxjV58hVtWTbDM.ewlbSYgvIxVOqiP1lD2zeDKWBGEZMRfO_4kJyLRP_4U
important: do not put any html tag, just the plain text above.
Then just continue following the tutorial. Good luck.

Yii framework, link doesnt redirect to server

I have some problem in Yii Link. My application works fine in localhost but i have move it into server. All the link in server is redirecting to localhost. Can anybody help me out in this situation? Should I have to add something more in configuration file. Thanks in Advance.
Did you use CHtml::link() to create your link? And if you've done it so for the url did you provide an array as follow:
array('Controller/Action', 'param'=>value)
Example:
array('post/list', 'page'=>3)
At the end you'll obtain:
CHtml::link("your text link", array('post/list', 'page'=>3));
(I'm asking it because if you've written every link in hard, it's normal to have each link redirecting to localhost!)

How to use relative URL's in website with two base URL's

I have our basic corporate static html website installed in our web root directory and our billing software installed in /portal. I have integrated the websites to look like a single site by including the /menu.tpl smarty template file in the /portal/header.tpl file. However, if I use relative URL's, the menu sysem doesnt work as the base url for the billing script is /portal. i.e. if I create a link to faq.php in the menu.tpl and I load a page on the portal site, the link in the menu back to the faq page is now /portal/faq.php whereby if I load a page off the root site the link is just /faq.php as it should be.
The obvious answer is to just use absolute URL's, but I need the site to be portable as I have many developers who need to install and test it.
I cant find anyway to resolve this. Any ideas?
I ran into the same problem as you a while ago, and after trying a lot of dead ends, I finally ended up with the following solution:
For any URL you need to be a chamelion, i.e. change its path depending on the environment, insert a PHP function that writes out the correct URL.
If you include the PHP function from a single central file, then you can change all of the URL's in the entire site automatically, based on a setting, or some pre-detected switch such as the current domain name, etc.
Example:
<?php print_base_url_plus("/menu.php"); ?>
... where print_base_url_plus() is a function which appends the base URL onto the output.
You may find that you have to change some of the URL's to be php, so they are preprocessed by the PHP engine, or, you can alter the web settings so that standard .htm files are piped through the PHP engine, just like .php files.

Url routing errors in php in codeigniter

My login form on front page is displayed, but when it posts to other pages, the post does not happen. THe problem is that the url is like: http://sitename/users/action which is a 404 not found url. But when i hard code the path to controller, (that is, stop using base_url + "/users/action" and use base_url + "/system/application/controllers/users/action") it starts working. How can i fix this problem?
Are you using .htaccess to hide index.php? If so, you need to take that into account with your routing. If not, you need to include it. e.g. if you're not hiding it, try:
base_url+"/index.php/users/action"
You can also try your config/config.php folder and fix your $config['base_url']...hope that helps.
i had the .htaccess file in the wrong folder, inside the system/application/config/ folder, instead of the root folder. after i pasted the file in the root folder, the problem was solved.