tags:

views:

73

answers:

4

hi,

I have installed my website in a subfolder www.server.com/folder/index.php

Is there any way to hide "folder/" in my url ?

The only solution I can think is to change Directory Root on the apache config file, but unluckily I don't have access to it

thanks

Update: all the solutions provided so far are not changing the url

A: 

In online, use .htaccess file for change the folder path.

Karthik
sorry for ignorance, what do you mean for "In online", you mean I can do it with an online running website ?
Patrick
by the way, I'm already using htaccess (redirect or rewrite) but I cannot hide the path from url
Patrick
A: 

Can you create files on root?

Symbolic link

You could create a symbolink link on your root directory:

ln -s /folder/ index.php
Rui Carneiro
is this solution hiding "drupal/" from the url as well ? or just forwarding ?
Patrick
@Patrick You are right, my solutions were just forwarding. I edited my original post in order to hide your `folder`
Rui Carneiro
thanks, uhm I get Internal Server Error when I try to use the ln command. If I use forward or rewrite rules it works instead.. but I need to hide the "folder/"
Patrick
Also, I dunno if this is related, when I add Options +FollowSymLinks I get Internal Server Error
Patrick
A: 

make .htaccess file, and put this:

Options +FollowSymlinks
RewriteEngine on
RewriteRule ^(.*)\.php$ http://www.server.com/folder/$1.php [nc]

everytime you access www.server.com/index.php will be redirected to www.server.com/folder/index.php

Jeaffrey Gilbert
if I add the line "Options +FollowSymlinks" I get an Internal Server Error. The Rewrite rules perfectly works without that line, however the "folder/" string is not hided from the url...
Patrick
Do you mean if you access folder/a.php it will hide 'folder/' string automatically in address bar? If yes, you can't do that because of security reason. Put familiar link in your anchor, and translate/redirect it by htaccess. The rest is handled by your page validation.
Jeaffrey Gilbert
I got 50% of your answer. Then I lost you: "Put familiar link in your anchor" ? "The rest is handled by your page validation" ?
Patrick
A: 

if you have your website installed on a server you can overlay it with a specific domain...

like www.example.com leads to www.server.com/folder/

In many backends it is an option to do this or even to say that www.server.com/folder/ is root directory

poeschlorn
so, I can do it only in the backend settings
Patrick
as far as I know, yes
poeschlorn