Webmaster Forum

Go Back   Webmaster Forum > Web Development > Coding Forum

Coding Forum Problems with your code? Discuss coding issues, including JavaScript, PHP & MySQL, HTML & CSS, Flash & ActionScript, and more.


Closed Thread
 
Thread Tools Display Modes
Share |
  #1  
Old 11-17-2014, 09:41 AM
kaushikparth kaushikparth is offline
Junior Member
 
Join Date: 11-17-14
Posts: 1
iTrader: 0 / 0%
redirect from www to non www domains

Hi, I recently started a blog trickedpc.com . But I need to know how can I redirect my visitors from www version to trickedpc.com .please help me .

Last edited by J. H. Rasmussen; 11-17-2014 at 09:46 AM. Reason: Moved to Coding Forum.
 

Advertisement

Advertisement

  #2  
Old 11-17-2014, 11:01 AM
HTMLBasicTutor's Avatar
HTMLBasicTutor HTMLBasicTutor is offline
Administrator
 
Join Date: 10-29-07
Location: Canada
Posts: 26,707
iTrader: 5 / 100%
It appears you are using CloudFlare and need to use their Page Rules.
 
  #3  
Old 11-17-2014, 10:31 PM
rootways's Avatar
rootways rootways is offline
Contributing Member
 
Join Date: 01-06-14
Location: Earth
Posts: 1,013
iTrader: 0 / 0%
First Backup your .htaccess then Try this code in your .htaccess file

Code:
RewriteEngine on RewriteCond %{HTTP_HOST} ^www\.yoursitename\.com [NC] RewriteRule (.*) http://yoursitename.com/$1 [R=301,L]
 
  #4  
Old 11-19-2014, 12:27 AM
ouaibmastaire's Avatar
ouaibmastaire ouaibmastaire is offline
Contributing Member
 
Join Date: 12-11-13
Posts: 52
iTrader: 0 / 0%
I use this in my .htaccess

Code:
RewriteRule ^ http://www.%{HTTP_HOST}%{REQUEST_URI} [QSA,R=301,L]
 
  #5  
Old 11-19-2014, 01:53 AM
alphaomegalady alphaomegalady is offline
Contributing Member
 
Join Date: 03-06-12
Posts: 149
iTrader: 0 / 0%
if in any chance you website is using asp.net, the yu have to use urlrewriting module

means you have to edit your web.config and add this



Code:
<rule name="Redirectwww" enabled="true" patternSyntax="Wildcard" stopProcessing="true"> <match url="*" /> <conditions> <add input="{HTTP_HOST}" pattern="www.domain.com" /> </conditions> <action type="Redirect" url="http://domain.com/{R:0}" /> </rule>
 
  #6  
Old 11-19-2014, 10:20 PM
HTMLBasicTutor's Avatar
HTMLBasicTutor HTMLBasicTutor is offline
Administrator
 
Join Date: 10-29-07
Location: Canada
Posts: 26,707
iTrader: 5 / 100%
Appears OP figured it out without letting us know resolved.

Thread closed.
 
Go Back   Webmaster Forum > Web Development > Coding Forum

Closed Thread


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

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

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
301 Redirect for Multiple Domains goodluckdomain SEO Forum 3 07-15-2011 05:43 AM


V7N Network
Get exposure! V7N I Love Photography V7N SEO Blog V7N Directory


All times are GMT -7. The time now is 07:29 AM.
Powered by vBulletin
Copyright 2000-2014 Jelsoft Enterprises Limited.
Copyright © 2003 - 2018 VIX-WomensForum LLC