Forum Moderators: phranque

Message Too Old, No Replies

url browser address bar change

using .htaccess

         

Valentiner

8:17 am on Aug 24, 2003 (gmt 0)

10+ Year Member



hello everyone!

i'm a newby here and I really am impressed by this forum. Hope you can help me too.

I have a small problem and don't know how to fix it:

i have a phpBB2 based forum in the directory www.mysite.com/phpBB/ and a portal.php in the www.mysite.com.

Using .htaccess file I have managed to make it such that when i hit "www.mysite.com" in the address bar, I am redirected to www.mysite.com/portal.php, but the adress bar remains "www.mysite.com" (portal.php doesn't appear).

I wrote something like

DirectoryIndex portal.php index.html

I would like to do this with all the files (even the phpBB2 indexz.file ), i.e. if I get to the www.mysite.com/phpBB/index.php?sid=true3212341 file I want the address bar to still show only www.mysite.com

Is it possible? How?

DaveAtIFG

4:12 pm on Aug 25, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Welcome to WebmasterWorld Valentiner, we're not ignoring you, I swear! :)

What you have done is to redefine the default page served when a request is made to your domain name.

Can the address bar made to display www.mysite.com for all pages at your site? Probably, but I don't know how to do it! :)

I don't think it's a good idea for a couple reasons, users will only be able to bookmark the home page, not specific discussions, and I suspect search engines will only index the home page of the site. Is this really what you want?

Valentiner

4:22 pm on Aug 25, 2003 (gmt 0)

10+ Year Member



yeah that's exactly what I want ... so is it possible ... i've seen it at a couple of sites ... but I don't remember which ...

closed

6:01 pm on Aug 25, 2003 (gmt 0)

10+ Year Member



I don't know if this works, but do you mean something like this?


RewriteCond %{REQUEST_URI} ^/phpBB(.*)$
RewriteRule .* http://www.mysite.com/index.html [R]
RewriteRule ^index.html$ /phpBB%1 [L]

If somebody requests something from the phpBB directory, redirect them to mysite.com's index.html file first. That changes the URL in the browser's Address bar. Then use an internal redirect to direct the visitor to the requested page.

dcheney

6:47 pm on Aug 25, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



A rather different approach might be easier - just use a frame.

Valentiner

7:21 pm on Aug 25, 2003 (gmt 0)

10+ Year Member



will it work with php (the frames) ... i'm talking about the phpBB 2.0.6 forum ..?

piramida

10:22 pm on Aug 27, 2003 (gmt 0)

10+ Year Member



yes, the only sane way would be to put the forum in a 100% wide frame. it would work I suppose, unless it adds target=_top to all links which is doubtfull.

mack

11:15 pm on Aug 27, 2003 (gmt 0)

WebmasterWorld Administrator 10+ Year Member Top Contributors Of The Month



When you say you have seen this done on other sites is is possible that this may be due to their domain name registration company offering then web diversion as opposed to web hosting. Generaly this is done using an almost frames setup where the domain points to a pagw with the redirected domain located within the page. Every time you click on a link you stay within th eframe an dthe page retains th edomain in the address bar.

One way to find out it to view the properties for an image. It will tell you the exact url if you right click and select properties. You can then paste the url into your address bar and remove everything after the .tld section.

Mack.