.htaccess load from sub folder but keep on showing main domain - .htaccess

I have a install that has a web folder that has the website stored in this. How can I make the domain load from this folder within the public_html folder.
The domain is like: sub.domain.co.nz

Don't put the entire Symfony project under the public_html folder - this will cause all of the project files to be accessible over the web, including .yml files that include sensitive information like database passwords!
Put the Symfony project files in a folder that is not web accessible. Then configure your web server so that the DocumentRoot points to the path of the web folder of the Symfony project, and also modify the paths of all the aliases.

Related

Sharing dozens of subdomains in one robots.txt of the main domain

In hosting, there are folders of a.mysite.com, b.mysite.com, c.mysite.com ....z.mysite.com within the root folder of mysite.com, and each site file is stored.
What I want is without installing all robots.txt files in each subdomain folder.
It is to install only one in the mysite.com root folder and share it all. Because all you need is a robots.txt file in its most basic form.
so in the end
When connecting to a.mysite.com/robots.txt, b.mysite.com/robots.txt, etc., you want to be properly connected to the robots.txt file.

Denied accessible config folder in yii2

So i got this yii2 project, it works fine when i open the URL with http://localhost/myproject/index.php/login/index, but when i open http://localhost/myproject/config/, http://localhost/myproject/uploads/ and http://localhost/myproject/web/access it can access folder inside it.
how can i hide those folder or disable to access it by public?
here is the screenshot how it look like when i open those URL
i don't know why there is no htaccess in this project (i continue the project from the previous developer)
at the root of the project add a file called index.php with a redirect to the web folder like this
<?php
header("location: web/");
?>
with this when entering the root you will be redirected to the web folder, which will load your project and you will not see the folder structure

Where to get the WEB-INF folder for a site present outside of cfusion/wwwroot?

I have just put all my project files in E:\testproj and created a new site IIS pointing to this folder.
I have also changed the host file also accordingly. But in the default cfusion/wwwroot folder there is folder called WEB-INF.
But in my project folder there is no WEB-INF folder. I need some modification on WEB-INF/web.xml .
Shall I add it as a virtual directory to my site or is there any other way?

how to change document root to public_html from root directory

For testing I hosted my website on free server from 000webhost.com
They have a directory structure:-
(root folder) \
(public folder) \public_html
this directory structure enables to keep all the library files in root folder and all public data in \public_html, so I developed my website accordingly, and my final structure looked like:-
/
/include(this folder contains library files)
/logs(log files)
/public_html
/public_html/index.php
/public_html/home.php
/public_html/and other public files
on 000webhost makes only public_folder available to be accessed via url and my url looked neat and clean like
www.xample.com/index.php
or
www.example.com/home.php
but after completion of development I moved website to shared host purchased from go-daddy.com, now they do not have any such kind of directory permission, all the files are kept in root folder and are accessible via url also url has become like:-
www.example.com/public_html/home.php
or
www.example.com/public_html/index.php
How should I redirect url request to public_html folder again so as to make library file unavailable to public access and make url neat and clean.
Does Godaddy allow you access to Apache?
If so you might be able to modify document root in such a way that the public folder is on the same level as the library and log folders.
Otherwise you will be left in the same situation as many other who use shared hosting and have to protect your folders with .htaccess files.

Apache - Restrict sub folder files, listing or including parent folder or files

I am in a shared hosting and I have made some space for my friend to host his website. As i know the power of a simple php script, I want to restrict my parent folder being accessed by Sub folder files. What this actually mean is, "My friend would have access to his domain folder only". He can neither include any file outside his root directory nor list the files.
public_html/ is the root of my directory
public_html/myfriend.com/ is the root of my friendss directory
I want to learn both.
01: public_html/ can be accessed by all the files except the files in folder myfriend.com/
02: public_html/ can be accessed no file in sub directories.
This would help me a lot.
Reminder: As a shared hosting holder, I don't have access to httpd.conf
Any way With httpd.conf or Without httpd.conf?
Well, it is all done server-side, so why not to create you friend seperate FTP User, MySQL user, restrict access to SSH and in FTP settings make /public_html/friendzone the root folder of his FTP User?

Resources