Forum Moderators: phranque

Message Too Old, No Replies

mod_rewrite - Getting the URL bar to display ONLY the URL

         

djcronos

11:55 pm on Nov 21, 2005 (gmt 0)

10+ Year Member



Hey folks,

I hope this is a quick implementation, but I'm looking for a way to have the URL that is displayed in the address bar of IE/FireFox/Opera/etc. to only display www.url.com, no subpaths or anything.

For example, I go to www.url.com. I click on "About Us", and it goes to the About Us page, but the URL still displays www.url.com in the address bar.

Is this possible using mod_rewrite, or am I barking up the wrong tree?

If this isn't possible, does anyone suggest an alternative?

Any insights are appreciated. Thanks in advance!

a1call

1:08 am on Nov 22, 2005 (gmt 0)

10+ Year Member



Hi djcronos,

I can think of three ways to do that. One is using frames where the "about" document would appear in a frame in index.html

This is not recommended because SEs are frame incompatible.

The other is using forms where the about link would post a keyword such as about to index.php which would be url rewritten to www.example.com which generates the content of the about document

The other is using JavaScript where the about link turns the "about content" visible and and everything else invisible.

The latter method is probably the most SE friendly and ergonomic, but might raise a red flag with Google as hidden spam.

Philosopher

1:09 am on Nov 22, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



arrghhh...too slow. :)

djcronos

12:07 am on Nov 23, 2005 (gmt 0)

10+ Year Member



Hey guys thanks for both the responses. I believe I was misinformed as to what needs to be done. Here's what I've done so far, and where I am at currently.

I have a site that has three domain names. I want to have it to where if you enter [*.domain.com...] to point to [thedomain.com....] I have the following set up:

RewriteEngine on

#Redirect [thedomain.com...] to [thedomain.com...]
RewriteCond %{HTTP_HOST} ^thedomain.com
RewriteRule ^(.*)$ [thedomain.com...] [r=301,L]

#Redirect [d0main.com...] to [thedomain.com...]
RewriteCond %{HTTP_HOST} ^d0main.com
RewriteRule ^(.*)$ [thedomain.com...] [r=301,L]

#Redirect [d0main.com...] to [thedomain.com...]
RewriteCond %{HTTP_HOST} ^www.d0main.com
RewriteRule ^(.*)$ [thedomain.com...] [r=301,L]

As it is currently, if I type www.d0main.com it will show [thedomain.com...] in the browser. I'd like to get rid of that 2nd slash at the end.

Now, I know the above doesn't do a catchall for subdomains, but I'd like to point *.domain.com to [thedomain.com....] How would I do that?

Thanks again everyone!