How to hide folder path with `Netlify`? - netlify

I’m hosting a static site with Netlify.
My site pages are all in a folder called pages.
For example, when I open the Contact Us page, it looks like this:
mysite.com/pages/contact-us
How can I hide the /pages path in the url?
Netlify uses a _redirects file for redirects/rewrites.. but I still haven't been able to figure out how.

Related

Laravel: I can not visualize images when uploading the web to my Hosting

I have a web developed in Laravel, in local I can visualize all the content of the web without problems, I have uploaded the web to my hosting in the domain folder where I want to have the web (it is a shared hosting with several domains), I configured the base of data and modified the .htaccess file. The web loads, however it does not display the logo or the images stored in public / images.
Any idea what this is? I appreciate any guidance
I advance that my web is not in the public_html folder, because that folder is occupied by another web. All the files are in a domain.com folder
This is the method I'm using to call the images src="{{asset('images/test/home/banner-home.jpg')}}"
I have already checked and there are no syntax errors between uppercase and lowercase.
this is the error that I receive in each image:
Failed to load resource: the server responded with a status of 404 (Not Found)
you can do it this way:
in your domain.com, create another folder and move all the files and folders to the newly created folder.
from the newly created folder, copy all the files and folders in public back to domain.com
open your index.php in domain.com and configure this:
i. require DIR.'/newlycreatedfolder/vendor/autoload.php';
ii. $app = require_once DIR.'/newlycreatedfolder/bootstrap/app.php';
i hope all your header files are called using: {{ asset() }} and your logo using {{ url() }}

How to get sitemap of webpages?

I am trying to analyze some page and to get all necessary information I need to know their web structure ( sitemap - map of web-pages, something like this Czech pages or Harvard pages )
Is there some online service or program to which I give URL of page and then it display sitemap (I know that there can be link to other pages but if the service would have option to search only to some level it would be great)
Sitemap is often present in a file, located at root of website, and named sitemap.xml.
eg : http://www.abcdef.com/sitemap.xml
Otherwise, if it is not present, you can try to have a look in a file named robots.txt file (still at root of website)
It can be defined like that in robots.txt :
Sitemap: http://www.abcdef.com/sitemap.xml

Hosting a static site with Yesod

I'm experimenting with Yesod and I've created a simple scaffolding site with yesod. I've downloaded a bootstrap template site and wish to simply host this site with yesod. The template site has an index.html and a bunch of css and js files. This seemly simple task has baffled me. By my understanding, the site should be placed under the 'static' directory, I tried to use sendFile to send the index.html file in getHomeR, but only the content of the that file is displayed, without the css and js. Should I do this with a Subsite?
Thank you
Have a look in your browser console, most likely you're getting 404s due to bad relative links. I'd try using a redirect call to point to the static for so that all of the relative links are correct.

Making the Document Root dynamic

I have been searching and looking for the answer to this for SO long now without any joy, I hope someone can help.
Okay I have a web structure of:
Main folder - This is where you first land prior to logging in. After you log in you will be either directed to a number of websites that are resident in a sub-folder called websites. The problem I have is that I would like the document root, say the $_SERVER['DOCUMENT_ROOT'] variable, to default to the root of the website folder that it has been directed to. You see I have a lot of $_SERVER['DOCUMENT_ROOT'] in my php code and I use the '/' slash a lot in the href on my HTML tags.
I have seen that I could accomplish this by adding a .htaccess in the root of eiach website folder but 1, would like work for my situation and 2, could anyone please help me with the code. I understand I can use the RewriteRule command but I can't get my head around it. My folder stricture is like this:
login (index.html)
websites folder
website1 (index.html)
website2 (index.html)
website3 (index.html)
I have tried many versions of using RewriteCond etc but non of them work.
If anyone can help me out here I'd be very grateful.
Thanks
Nothing you can do in your htaccess file that's going to be able to change the document root. One thing that you can do is create separate domains that you can make their document roots point to each of the websites folders. Then proxy to one of those domains.
That way the URL on the browser doesn't change domain names, and internally, you're proxying requests back to yourself and the individual website domains will each have their own document root.

Question regarding setting up a new website in htdocs folder

Today I moved my website to a new hosting company (Verio). I've done this lots of times before, and I know that your website should go inside the "htdocs" folder.
Now usually when I use FileZilla, I can do a "Right Click" on a filename to get the URL of that file. This is the result of my root default file: ftp://test#test.com/www/htdocs/Research/index.php
However, on the web, the true URL of my default file is: www.test.com/Research/index.php
My index.php file is in the website root folder. Does anyone know why FileZilla would include the server folders "www/htdocs" as part of the URL? These folders should not normally be visible to the user.
OR, is this look correct?
That ftp url is correct. Your FTP account has access to the two folders (www/htdocs/) before the document root, as most hosting providers provide.
You are also correct to assume that http access is limited to the document root. (Meaning they cannot see www/htdocs/)

Resources