|
| | Remove www from URL using mod_rewrite
You may choose not to have www alias for your domain, so that www.domain.com will redirect to domain.com, use mod_rewrite and .htaccess to achieve this. (This may be useful if for example you have a really long domain name)
Put the following into your .htaccess
RewriteEngine on
rewritecond %{http_host} ^www\.domain\.com [nc]
rewriterule ^(.*)$ http://domain.com/$1 ... | | More... 02/19/06 | | | | |
|
| | mod_rewrite on Windows (overwrite URLs)
Can't get mod_rewrite (rewriting URLs) working on Windows? The solution is fairly simple. Make sure you have the following in your httpd.conf. Replace "C:/www" with the directory under your DocumentRoot where you placed .htaccess file. Once you've copied the lines below into Apache configuration file restart web server and URL ... | |  More... 11/28/05 | | | | |
|
| | Using mod_rewrite to redirect from dom.com to www.dom.com
Normally you will want your users to browse to www.mydomain.com instead of mydomain.com. It is good for search engine optimization to have one destination. It's also useful when you use cookies to keep users logged on when they are accessing different subdomains i.e. www.mydomain.com, shop.mydomain.com, forum.mydomain.com etc. You can use ... | | More... 10/26/05 | | | | |
|
|