FRIHOSTFORUMSFAQTOSBLOGSDIRECTORY
You are invited to Log in or Register a Frihost Account!

URL rewriting

 


ltwomba
Hi,
I'd like to make the default directory forward to /web/ but not showing the /web/ in the URL.
I used this in my .htaccess:
Code:
RewriteEngine on
RewriteRule ^$ /web/ [R]

but you still see the /web/ in the URL. Is it possible to hide it?
Thanks.
TomS
URL-cloaking is only possible with Frames (as far as I know)

content of index.htm

Code:
<html>
<head>
<title>Page title</title>
</head>
<frameset 100%,0>
<frame src="./web/">
</frameset>
</html>
Ranfaroth
What you want to do is not rewriting, but redirection...
TomS
The Rediractionfunction of htaccess shows also the folder it redirects to.

Dunno the syntax by heart but anything similar to this:

"Redirect . /web/"

So www.yourdomain.com/site1.php will show www.yourdomain.com/web/site1.php

also in the adressbar. The /web/ is also there.

But if you use the framesolution I'm not sure if
yourdomain.com/anypage.php will show yourdomain.com/web/anypage.php

That would be the only problem with this. Just test it out.
Stubru Freak
ltwomba wrote:
Hi,
I'd like to make the default directory forward to /web/ but not showing the /web/ in the URL.
I used this in my .htaccess:
Code:
RewriteEngine on
RewriteRule ^$ /web/ [R]

but you still see the /web/ in the URL. Is it possible to hide it?
Thanks.


Remove the [R]?
Ranfaroth
TomS wrote:
The Rediractionfunction of htaccess shows also the folder it redirects to.

Dunno the syntax by heart but anything similar to this:

"Redirect . /web/"

So www.yourdomain.com/site1.php will show www.yourdomain.com/web/site1.php

also in the adressbar. The /web/ is also there.
In fact, I thought he wanted the contrary (/web/ to /)

But to to make the default directory forward to /web/ is in fact easy :
Rewrite the URLs /something to /web/something.
The user won't see the "web" in the URL...

Quote:
But if you use the framesolution
You shouldn't. Frames are deprecated, and have so many drawbacks that you have to forget about them.
Reply to topic    Frihost Forum Index -> Scripting -> Html, CSS and Javascript

FRIHOST HOME | FAQ | TOS | ABOUT US | CONTACT US | SITE MAP
© 2005-2007 Frihost, forums powered by phpBB.