April 7, 2012

Hide "www" text in URL bar (firefox)

Question by Futur Fusionneur

I was wondering if it is possible to hide the “www” text in the URL bar (only in Firefox) using CSS in Stylish addon or/and Java in Greasemonkey.

I want this to make Firefox even more compact.


This is some CSS code that i found for URL bar in firefox that will modify the text size using Stylish. Hope it can help.

@namespace url("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul");

.urlbar-input-box,
.searchbar-textbox {
 font-size: 11px !important;
}

Update

I don’t want to remove the “www”, I just want to hide it from the url bar.

Answer by Starx

You have to use .htaccess for this

RewriteEngine On
RewriteCond %{HTTP_HOST} ^www.example.com$ [NC]
RewriteRule ^(.*)$ http://example.com/$1 [R=301,L]

Replace example.com with your domain name.

Author: Nabin Nepal (Starx)

Hello, I am Nabin Nepal and you can call me Starx. This is my blog where write about my life and my involvements. I am a Software Developer, A Cyclist and a Realist. I hope you will find my blog interesting. Follow me on Google+

...

Please fill the form - I will response as fast as I can!