Questions tagged [public-html]

141 questions
1
vote
1 answer

Prevent access to files of other users

In my server (cpanel) I see now that with a simple DIR script (PHP) I can list files of all users over public_html /home/[user]/public_html/ How can I prevent users from accessing the files of other users?
Leo
  • 1,753
  • 3
  • 20
  • 23
1
vote
1 answer

How to access folders inside public_html from user directory in URL

I have a user directory on a domain such as www.something.com/~user/ and I want to be able to both create and access a folder like www.something.com/~user/folder/ In UNIX I can make a directory inside the public_html folder, but I'm currently unable…
user3196916
  • 11
  • 1
  • 2
1
vote
2 answers

Is it safe to include files from outside public_html?

I am working on a system where the user is only allowed to visit most of the pages if he is logged in correctly. Instead of checking for a correct login on every single page, I am about to make a check on the index page, and including all other…
user2806026
  • 787
  • 3
  • 10
  • 24
1
vote
1 answer

Laravel 4 - Options not allowed here in the .htaccess

I have installed Laravel 4 on my public_html folder locally, and I can access its public folder when declaring a vhost pointing to it, through the vhost url. But, when I try to access Laravel public folder through its parent folders, I get an…
Hakim
  • 3,225
  • 5
  • 37
  • 75
1
vote
0 answers

How do I create a public_html structure on apache localhost?

I want it such that when I type "localhost/websiteName/" on my local machine I would be served "localhost/websiteName/public_html/". Is this possible ? Or am I missing something here ? I also want to make everything outside public_html inaccessible.
1
vote
2 answers

Swapping the public_html folder for quick website change

I have two versions of the site which I have to swap really fast, multiple times. In my home directory, I have: drwxr-x--- 8 lorem nobody 4096 Jul 12 20:50 public_html/ drwxr-x--- 3 lorem nobody 4096 Jul 13 12:59…
Vanja D.
  • 834
  • 13
  • 20
1
vote
0 answers

Appach: What permissions should public_html have?

I have an appache server running on Linux - CentOS. Searching around the web I found several answers to the question in the title. Can someone please provide a reliable reference to this critical question?
Subway
  • 5,286
  • 11
  • 48
  • 59
1
vote
2 answers

How can I access files outside webroot within an HTML tag?

I am on a shared host and do not have access to the php.ini or apache config files. I have PHP class files stored outside webroot that I need to access with HTML and I know that
will not…
Monica
  • 1,585
  • 3
  • 23
  • 34
1
vote
1 answer

Javascript OnClick event

Here's a bit of code from a simple currency converter I'm building. The calculate() script runs fine, but the clear() code refuses to work and it appears the same?? US - CDN
publisher
  • 11
  • 4
1
vote
1 answer

Ajax call to private folder / php file from main site domain (public_html)

I am in the process of migrating my site to a server from its localhost location. In my server root, I want to have a public_html folder that maps to the main domain, and a private folder that contains my resources (models, libraries, templates, php…
Rafie
  • 569
  • 1
  • 5
  • 10
0
votes
1 answer

how to emulate public dir with mod_rewrite

I keep my website files in /public/ directory. So, for example, to access css file, if we point absolute html path, it would be /public/css/reset.css. I have /public/index.php file that handles every request. So, my main site API works fine. Here's…
Larry Foobar
  • 11,092
  • 15
  • 56
  • 89
0
votes
0 answers

Hide .html extension for only public_html files

I make the .htaccess to hide all .html extension for all files hosted in the public_html but I don't want it to affect the rest of the directories since there are .php files. RewriteEngine On RewriteCond %{REQUEST_FILENAME} !-f RewriteRule…
Dario
  • 11
  • 4
0
votes
1 answer

Symfony 6 problem when uploading files in production

With my project symfony, when deploy my website on hostinger, i have a problem with my uploading files. The files i want to upload on my website must be store in "/public_html/css/images/" but symfony create a new directory named…
0
votes
1 answer

Path of images inside public_html in cpanel inside Laravel

In cpanel, the entire content of the site is inside the AryaBMS file, and I put only the public folder, which contains images, index.php, htaccess, etc., into public_html. I want a notification in Telegram that is done through a cron job, I want to…
0
votes
1 answer

I dont know why my app is returning undefined

When I add this code to my app.js in the express server app.get('/*', function (req, res) { res.sendFile(path.join(publicPath, 'index.html')), function(err) { if (err) { res.status(500).send(err) } …
dialac
  • 21
  • 4