Jump to content

How to hide the real path of a file in Browser using Alias and <Directory>


g_p_java

Recommended Posts

Hello guys, i would like to make a question related to aliases.

 

I have configured my http.conf file and i have placed

 

NameVirtualHost 127.0.0.1:80

<VirtualHost 127.0.0.1:80> 
   ServerAdmin admin@mail
   DocumentRoot "C:/project/www/site/e-shop"
   ServerName eshop.local
   Alias	/manager	"C:/project/www/site"
</VirtualHost>

<Directory "C:/project/www/site">
    Options Indexes FollowSymlinks MultiViews Includes
    AllowOverride None
    Order deny,allow
    Allow from all
</Directory>

 

Well, when i type in the browser "eshop.local/manager" it's working.

My problem is that when i clink somewhere else, the browser reveales the true path.

 

That's a problem, e.g. my browser shows "http://XXX.XXX.XXX.XXX/site/multi.php" and even eshop.local is not there.

 

What option shall i place in the <Directory> here</Directory> in order to hide in the browser the true path and show only eshop.local/manager path????

As i can see, the site it's working, but the fact that it reveales the truth path, it's something i wouldn't like to happen.

 

Thanks, in advance!

have you given absolute path on the hyperlinks? can you post the code of the hyperlink???

 

Thanks for replying, well in my code sometimes i refer to an image like ../../images etc.

I'm sorry for asking but i didn't quite understand the question.

Where am i supposed to find the code of the hyperlinks???

as you mentioned when you click on somewhere [i am assuming that you are clicking on the hyperlink] . So, you must have written some code for that hyperlink like

 

<a href='mypage.php'> My Page </a>

 

Can you post that code??

<a href='mypage.php'> My Page </a>

Can you post that code??

 

Well, in my php files i refer to hyperlinks like

 

<a href="<? echo $site_root?> or <a href="categories/search_category.php"> or 
<a href="<? echo $site_root.$root_content."my_images/".$_SESSION['opi'][$y-1]['FILENAME'];?>">

 

Well i use headers and requires, i don't know if they cause a problem

require '../my_inc/user_auth.inc';
require '../my_inc/init.inc';
require 'my_inc/categories_files.inc';

 

In my init.inc files i have defined

 

$root_site = "http://XXX.XX.XX.XX/site/";
$root_content = "eshop/content/"

 

I cannot understand what causes the problems, Thanks

Bro, if you will use the absolute path i guess which you are doing in your case then problem which you have mentioned will be there,

 

Absolute path is

 

<a href="http://www.mysite.com/products">Products</a>

 

I guess you will have to use relative path so your anchor tag should be:-

 

<a href="http://www.mysite.com/products">Products</a>

 

Try to create a hardcore relative URL and see wht happens when you click on it....

 

 

Or as an alternate.....

 

try to use base href in your head tag

 


<base href="http://eshop.local/" />

 

 

 

 

 

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.