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

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.

Related

How to run Nuxt (vue js framework) app on aws instance

I am not vue js guy but I am trying to learn and run project on aws.
I could complete up to this.
I just want to change localhost to my IP address.
I checked few documentation where they referred to change nuxt.config.js but still I could not get where exactly I need to make change.
In Flask If I change host name from localhost to "0.0.0.0" in app.run. It start running on my IP address. Is there any similar concept here?
Any help highly appreciated.
Edit 1
This is how my present code structure

Yii 2 Advanced Template url

I've installed advanced template on my local system but I can't seem to figure out the url, or the url is not working?
Advanced template is installed under advanced directory.
None of following works
http://localhost/yii/advanced/
http://localhost/yii/advanced/web/
http://localhost/yii/advanced/web/index.php
http://localhost/yii/advanced/frontend/web/index.php
What is the url to access website after advanced template is installed? I can see all folders and files under /advanced. Is there any error with installation?
Following is the error I'm getting:
Not Found
The requested URL /web/index.php was not found on this server.
The advance template consist of 3 diff apps frontend, backend and console. Where console is for the Cli and the rest for web, it isnt like basic-app, so you need to access it via http://localhost/yii/advanced/frontend/web/index.php or http://localhost/yii/advanced/backend/web/index.php

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

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.

Resolving a sub directory to a Heroku app via .htaccess?

I use a Media Temple Grid Service solution for hosting. I currently have a Heroku app which I serve via blog.domain.com using a CNAME record.
I'm trying to have the sub-directory domain.com/blog resolve to the Heroku app instead. I don't want the header to change, so I'm not looking for a redirect I believe.
I've attempted a couple of snippets for .htaccess files which have not worked for me. Can anyone recommend some tips to have this work?
It seems a proxy pass would work from the research I've done, but I can't figure out where or how to set it up given my GS folder structure.
Any help is much appreciated. Thanks in advance.

Rails 4 images in public folder are not loading on Apache development

I am new to rails. I am working on a sample application for social networking. I have managed to upload the profile picture of users manually (By copying the image uploaded to /tmp/image to the public folder- public/images/tmp/image) and saved the path to db as avatar_url.
In the profile view I used
<%= image_tag(#userinfo.avatar_url, :alt=>"Avatar image")%>
and getting the picture when running on the rails server.
But after that I have deployed the app in apache with passenger in the development environment by setting RailsEnv development. After that the images are not loading. I tried to go to myip:80/public/images/tmp/image, and it gives Routing Error.
After searching on the web, I found that adding config.serve_static_assets = true in production.rb will solve the problem in production. But no use for me because it also stated that the static files will serve in development by default. For confirming the problem again, I started the rails server and opened localhost:3000/profile, image is there and not getting the image in myip:80/profile.
So do I need to add any other config. Or am I not supposed to do that in this way.
Finally, I got the solution for my problem. Just sharing here.
The problem was actually because of permission issues. The picture will be created in a root temp directory on the form submission. Then I copied the image form the temp folder to the public folder. Hence it has only read permissions. After I deployed it, the image gets returns 403 forbidden error.
I used,
FileUtils.chmod 775, target
to set the permission. After that it worked well.
The option config.serve_static_assets = true tells rails to serve the static assets for your application, but that job should really be left to Apache.
Your issue sounds more related to your Apache configuration than rails.
I would take a look at a tutorial on how to configure Apache and Passenger to make sure your environment is setup correctly.
Anything in the public folder should be served by the web server. However myip:80/public/images/tmp/image is not a valid path. You would need to also have a filename at the end with an extension.