7 Replies - 4547 Views - Last Post: 22 August 2012 - 01:59 AM

#1 olibenu  Icon User is offline

  • D.I.C Addict
  • member icon

Reputation: 45
  • View blog
  • Posts: 537
  • Joined: 31-December 08

using several ../, is it only way to public_html

Posted 04 August 2012 - 09:34 AM

i'm about to use ../../../../ to get to some css files and hrefs.
is there an environment variable for the public_html folder in cpanel? if there is, how do i call it?
Is This A Good Question/Topic? 0
  • +

Replies To: using several ../, is it only way to public_html

#2 Lemur  Icon User is offline

  • Pragmatism over Dogma
  • member icon


Reputation: 1359
  • View blog
  • Posts: 3,425
  • Joined: 28-November 09

Re: using several ../, is it only way to public_html

Posted 04 August 2012 - 09:49 PM

Normally you should just be able to refer to it as /, but why would you have them in such a different directory like that? It sounds more like you would want to look into redefining your structure instead of finding a way to monkeypatch some poor design.
Was This Post Helpful? 3
  • +
  • -

#3 olibenu  Icon User is offline

  • D.I.C Addict
  • member icon

Reputation: 45
  • View blog
  • Posts: 537
  • Joined: 31-December 08

Re: using several ../, is it only way to public_html

Posted 04 August 2012 - 10:58 PM

please, can you make your point clearer. yes, i can use /cpanelusername/public_html (am i correct in thinking this is what you refer to?) but i'm developing the site in a folder on my windows os and would like to test it there and just ftp it. so, using / may not cut it for me
Was This Post Helpful? 0
  • +
  • -

#4 Lemur  Icon User is offline

  • Pragmatism over Dogma
  • member icon


Reputation: 1359
  • View blog
  • Posts: 3,425
  • Joined: 28-November 09

Re: using several ../, is it only way to public_html

Posted 04 August 2012 - 11:22 PM

/ refers to the root directory of the web server. It should be directed to Public HTML. You can alias it in Apache's configuration, I was just saying that for the most part if you have to use a lot of directory traversal you're trying to patch something that can be fixed by better design.
Was This Post Helpful? 3
  • +
  • -

#5 olibenu  Icon User is offline

  • D.I.C Addict
  • member icon

Reputation: 45
  • View blog
  • Posts: 537
  • Joined: 31-December 08

Re: using several ../, is it only way to public_html

Posted 10 August 2012 - 10:04 PM

it worked. / resolves to public_html but i had to use a webserver to test it because just opening the web pages from explorer didn't work.

also something weird. i made people.website.com/olibenu point to website.com/people/olibenu and they look different! same text but some css and graphics (with path starting with /) were not loaded.
is / still html for a domain and its subdomain?
Was This Post Helpful? 0
  • +
  • -

#6 ToshNeox  Icon User is offline

  • D.I.C Head

Reputation: 8
  • View blog
  • Posts: 100
  • Joined: 10-December 11

Re: using several ../, is it only way to public_html

Posted 21 August 2012 - 04:32 PM

Redirecting to different places may be causing issues with which stylesheet is loaded etc. It may be wiser to store all files in / and just refer to them via the URL (i.e. http://website.com/stylesheet.css).

For testing purposes I recommend you always use a webserver running on your PC as you can run more things than opening it in a browser. You can also take advantage of any Apache functions and you'll have a closer environment to that of your real website - which is much easier to develop with.
Was This Post Helpful? 0
  • +
  • -

#7 Lemur  Icon User is offline

  • Pragmatism over Dogma
  • member icon


Reputation: 1359
  • View blog
  • Posts: 3,425
  • Joined: 28-November 09

Re: using several ../, is it only way to public_html

Posted 21 August 2012 - 08:14 PM

View PostToshNeox, on 21 August 2012 - 06:32 PM, said:

Redirecting to different places may be causing issues with which stylesheet is loaded etc. It may be wiser to store all files in / and just refer to them via the URL (i.e. http://website.com/stylesheet.css).

For testing purposes I recommend you always use a webserver running on your PC as you can run more things than opening it in a browser. You can also take advantage of any Apache functions and you'll have a closer environment to that of your real website - which is much easier to develop with.


....how is a local server "easier" than an actual server? I guarantee you that any professionally hosted server has more than enough tools and has far more horsepower than much of any home server that a starter can come up with. As far as development, that makes no sense. The server can be halfway across the world, and the only difference in difficulty is negligible at best.

You have to open a browser to view anything on the web.

I'm sorry, but your post makes no coherent sense mate.
Was This Post Helpful? 2
  • +
  • -

#8 ToshNeox  Icon User is offline

  • D.I.C Head

Reputation: 8
  • View blog
  • Posts: 100
  • Joined: 10-December 11

Re: using several ../, is it only way to public_html

Posted 22 August 2012 - 01:59 AM

View PostLemur, on 21 August 2012 - 08:14 PM, said:

View PostToshNeox, on 21 August 2012 - 06:32 PM, said:

Redirecting to different places may be causing issues with which stylesheet is loaded etc. It may be wiser to store all files in / and just refer to them via the URL (i.e. http://website.com/stylesheet.css).

For testing purposes I recommend you always use a webserver running on your PC as you can run more things than opening it in a browser. You can also take advantage of any Apache functions and you'll have a closer environment to that of your real website - which is much easier to develop with.


....how is a local server "easier" than an actual server? I guarantee you that any professionally hosted server has more than enough tools and has far more horsepower than much of any home server that a starter can come up with. As far as development, that makes no sense. The server can be halfway across the world, and the only difference in difficulty is negligible at best.

You have to open a browser to view anything on the web.

I'm sorry, but your post makes no coherent sense mate.


I see why you don't get my reply. I was referring to if you were testing specific htaccess files etc. If you just open it in your browser then it will ignore any special apache files as they're only, well, recognizable by apache.

Also if you want to use server side features such as databases, or start using server side languages, a webserver is a 1000% must to be able to view the pages.

I've also found that opening the files in browsers can have issues with layouts too.

For production purposes, you obviously need to upload to your public webserver. But for testing, WAMP/MAMP/XAMPP running on your Windows/Linux/Mac would be adequate. I wasn't trying to say that the webserver will have any more power, nor will it matter as only you can access it, but for testing purposes (and as I said for SS stuff) you will always need it.

Hope I explained it right this time.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1