Vue.js dist folder when copied to Shared hosting site's subfolder is not rendering and showing a blank page - https

After successfully running npm run build I copied the contents of the /dist folder in my local wwwroot folder. Everything renders correctly and I an see my page.
The problem comes when I copy the same contents of the /dist folder to a sub-directory on a Shared Hosting site (Domain.com or GoDaddy.com): https://www.mywebsite.com/sub-directory
All I see is a blank page. Upon checking the Network tab in developer tools, I see all requests status come back with 200 Status Code.
At this point I have thrown the towel and would appreciate any help I can get.

I went around my problem and solved it in another fashion. Instead of making a subfolder in /public_html folder, I created a subdomain using the configuration menu. Therefore my site looked like: https://mysubdomain.myoriginalsite.com
While creating a subdomain, the shared-hosting site's configuration asks me what should be the folder for this newly requested subdomain.
So I created a folder in the root (same level as /public_html) called /mysubdomain and copied all my files from /dist folder over there.
It worked like a charm.
Please NOTE: In vue.config.js file I updated my publicPath variable to be '' instead of '/'

Related

How to hide folder routes on EC2

I have an EC2 instance that hosts my site, and I have a question about it, well, I have folders inside the lamp's html folder, example folders are css, js, assets, and the problem is that whenever I type the domain of the site with the route of a folder or any other file, this is opened, example ec2-blah-blah-blah.com/assets (it shows everything inside the folder assets). The question is, how can I hide this? I don't want anyone to have access to folders or x files

After successful installation, xampp redirects to localhost/xampp

I have followed Drupal's tutorial on how to successfully run a Windows server using xampp. I think I've done everything right, but when I go to my website, it goes to mywebsite/xampp.
Does anyone know what I need to do to solve this?
Which folder did you put your website files? What address did you type in the address bar? If using localhost or any other domain which redirects there, be sure you rename any index.php or index.html in the server root folder (htdocs). This is because most servers look for any file named this way when visiting any server folder and will automatically display that page when it finds it.
In this case since you freshly installed xampp, their homepage is probably set to show by default
For example look at the picture. This is the index.php file in the htdocs folder. At the top you can see I've added a header to redirect to somewhere else. Below I commented out the code that was defaulted by the xampp installation, which pretty much said to relocate to the xampp/ directory (which then loads the index file there). If it failed to go there, you should see the message at the bottom
Something is wrong with your xampp installation :-(
If you're being redirected to the xampp/ directory you simply need to rename or edit the index.php file in the htdocs folder.
Ideally you should make a separate folder for your website in the htdocs folder, something like htdocs/myWebsite.
You can name your homepage either index.html or index.php (depending on which language you use) and then go to localhost/myWebsite and it will automatically load your homepage.

Pyro CMS - trying to move files/folders up a directory level

I did a Pyro test installation at mydomain.com/pyro, and now that I have the site configured, I wanted to move everything up to the root directory. It worked fine, except for when I leave off the "www" in my URL, so:
'www.mydomain.com' works fine, all of the navigational links point to the right pages
'mydomain.com' does not work, all of the navigational links still point to the '/pyro/' test directory
I can't find anything in the config files or the database to change this.
How can I fix this?
Have you tried clearing you page cache? Utilities > Maintenance then under Cache Maintenance
Have you checked the default_pages.uri and default_pages.slug columns in your database?

app_code folder

Normally I only copy the dll files in the bin folder to update the website, when changing the codebehind.
I have made a change to a code file located in the app_code folder.
I have published the site and updated the bin folder with a lot of app_webxxx.dll files.
Now I get a parser error: Could not load the assembly 'App_Web_syn42ext
Is it possible to only update the dll files or do I need to update all aspx files everytime I make a change to get the website running ?
You need to do it as well, you need to update web pages as well, because if you will see when you publish the webpages in aspx page, on header tag, the reference of cs file upgrades itself.
So whenever you will publish there will be some random giud generated and will appended to file name, basically it reference to the name space.
So you will need to update web pages as well.

How to download images from the same folder as where the image is uploaded?

I am creating a project wherein the user can upload his photo. This photo is stored in the folder "images/uploads/filename". When his profile is created and the photo is to be shown, I use the <img> tag with src as "images/uploads/filename", but the photo does not show up.
If I manually copy the photo to an adjacent folder "images/abc/filename" and then use it as the source then it works.
How is this caused and how can I solve it? I need to use the same folder to upload and download photos.
That can happen if you're running the webapp as an IDE project and are storing the uploaded images in the IDE's project space. Changes in the IDE's project folder which are performed externally (as by your servlet code) does not immediately get reflected in the deployed server's work folder. Only when you touch it (by refreshing the project) or by copying it (as you happen to have found out), then it will get reflected.
After all, storing uploaded files in the webapp's deploy folder is a bad idea. Those files will get all lost whenever you redeploy the webapp, simply because those files are not contained in the original WAR file.
You need to store them somewhere outside the webapp's deploy folder on a different fixed path like /var/webapp/uploads. You should not use relative paths or getRealPath() to create the File object around it. Just use a fixed path. You can always make the fixed path configureable as a context param setting, a VM argument, a properties file setting or even a JNDI entry.
Then, to serve it to the world wide web, just add exactly that path as another docroot to the server config. It's unclear what server you're using, but in Tomcat it's a matter of adding another <Context> to the server.xml.
See also:
Uploaded image only available after refreshing the page
How I save and retrieve an image on my server in a java webapp
Make sure your have the correct path and include the image extension
just for testing, put your img tag inside the index.php
<img src="images/abc/filename.jpg">
/root/index.php
now put you image in to the your abc/ folder
/root/images/abc/filename.jpg
This should display the image.
if you have your img tag inside another folder in the root like below
/root/user/index.php
now when you use you img tag use this path (relative link):
<img src="../images/abc/filename.jpg">
note the beginning of the image path "../" this is used to go back to the root.
if the php or html file that is holding the img tag is even deeper, just remember to add ../ for every level, 2 folders deep whould be:
<img src="../../images/abc/filename.jpg">
Question was quite vague so hope this is what you are looking for.
let me know and if this is wrong, explain a little more and i will try to help :)

Resources