Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

Coding Forum


You are currently viewing our Coding Forum as a guest. Please register to participate.
Login



Reply
.htaccess redirect http://domain-name.com to http://www.domain-name.com
Old 06-20-2005, 11:02 AM .htaccess redirect http://domain-name.com to http://www.domain-name.com
Unknown.

Posts: 1,693
Trades: 0
Ive been using the following code..

Code:
RewriteEngine On
RewriteBase /
RewriteCond %{HTTP_HOST} !^www\.domainname\.com [NC]
RewriteRule ^(.*) http://www.domainname.com/$1 [L,R=301]
which redirects the domain from http://domainname.com to http://www.domainname.com to help in the search engines.. but anyway the problem is I've just registered another domain with a '-' in it.. like domain-name.com and i've tried using the same code..
Code:
RewriteEngine On
RewriteBase /
RewriteCond %{HTTP_HOST} !^www\.domain-name\.com [NC]
RewriteRule ^(.*) http://www.domain-name.com/$1 [L,R=301]
But it doesn't work.. so I quess it must be because of the '-'

So do I need to add something extra or make a change?

Thanks!
Dark-Skys99 is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 06-20-2005, 03:09 PM
Rufo's Avatar
Extreme Talker

Posts: 173
Trades: 0
All I can think of is that the '-' is being interpreted as a character range delimeter (even though these normally need brackets round them).
Try escaping it with a backslash.
__________________

Please login or register to view this content. Registration is FREE
Rufo is offline
Reply With Quote
View Public Profile Visit Rufo's homepage!
 
Old 06-20-2005, 03:32 PM
Unknown.

Posts: 1,693
Trades: 0
yeh thanks that solved it!

I thought that earlier but I must have used a forward slash instead by mistake so thats why i never worked!
Dark-Skys99 is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to .htaccess redirect http://domain-name.com to http://www.domain-name.com
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.56230 seconds with 12 queries