Welcome to City-Data.com Forum!
U.S. CitiesCity-Data Forum Index
Go Back   City-Data Forum > General Forums > Science and Technology > Internet
 [Register]
Please register to participate in our discussions with 2 million other members - it's free and quick! Some forums can only be seen by registered members. After you create your account, you'll be able to customize options and access all our 15,000 new posts/day with fewer ads.
View detailed profile (Advanced) or search
site with Google Custom Search

Search Forums  (Advanced)
 
Old 08-20-2013, 06:24 AM
 
Location: Cary, NC
43,324 posts, read 77,177,570 times
Reputation: 45665

Advertisements

I have framed a vendor site for years on my site, for my visitors' home search, and the vendor now has a significantly improved Wordpress plugin solution to which I have subscribed.

Vendor says I have to use a subdomain of my site to access the information and present it.
I have spread the domain around the internet for years, so I want to use a simple URL. Simple as possible.
Vendor suggested that many clients use "www." as a subdomain. I have seen some of those sites that do that, and it seems to work fine. But, I don't see that they are redirecting to navigate there.

We are trying to redirect my established site to the subdomain via my registrar's dashboard.
I.e., superduperdomain.com redirect to www.superduperdomain.com
Fail. It seems to be impossible to redirect to a "www." subdomain.

I don't want to customize every url in the code in the page to make it work, as one fellow told me I could do, including updating the customization with every WP update.
I can revise the subdomain from www. to something else, but that will create another term to remember.

Is www. subdomain attempt just not a workable redirection?
Reply With Quote Quick reply to this message

 
Old 08-20-2013, 07:39 AM
 
Location: Cary, NC
43,324 posts, read 77,177,570 times
Reputation: 45665
Oh.
Yes, I GOOGed it...
How to Redirect from Your Root Domain to the WWW Subdomain and Vice Versa Using mod_rewrite (thesitewizard.com)

That htaccess stuff is what I was trying to avoid.
Sounds like I need to go with Plan B. Whatever that is...
Reply With Quote Quick reply to this message
 
Old 08-20-2013, 10:15 AM
 
41,813 posts, read 51,088,087 times
Reputation: 17865
htaccess is going to be the easiest and most efficient, it's just the way it's done. You're trying to redirect all traffic from non www to the www versions?


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


Just a brief explanation here, this is called a regualr expression or regex for short and is used to match a string.

Quote:
!^www\.example\.com$ [NC]
The ! is used to indicate a negative, e.g. not a www address.
The carat indicates to start matching.
The bacwards slash is used to escape the period becsue the the period is used to match any single character, in this case you want to match the period itself.
The $ matches the rest of the string, that's used in the rewrite rule as variable.

The letters in brackets are commands, for example the R=301 indicates to use a 301 redirect when applying the rule.
Reply With Quote Quick reply to this message
 
Old 08-20-2013, 10:32 AM
 
Location: Cary, NC
43,324 posts, read 77,177,570 times
Reputation: 45665
Thanks, coalman.

This is work I hire out, and folks I am working with, and my domain registrar support are struggling.

And I was trying to not have more code in my WP sites to maintain through updates. But, that looks like the way it will be.
Reply With Quote Quick reply to this message
 
Old 08-20-2013, 12:36 PM
 
41,813 posts, read 51,088,087 times
Reputation: 17865
Well Mike I don't know what your specific needs are here but on most hosts you should be able to upload that code (replacing the example.com with your own domain) as .htaccess to the root directory and it's done deal.

This is common thing you should do on any site becsue it may be accessible through both the www and non www version which are technically two different locations. It's duplicate content.
Reply With Quote Quick reply to this message
 
Old 08-24-2013, 05:41 AM
 
Location: Cary, NC
43,324 posts, read 77,177,570 times
Reputation: 45665
Quote:
Originally Posted by thecoalman View Post
Well Mike I don't know what your specific needs are here but on most hosts you should be able to upload that code (replacing the example.com with your own domain) as .htaccess to the root directory and it's done deal.

This is common thing you should do on any site becsue it may be accessible through both the www and non www version which are technically two different locations. It's duplicate content.
Actually, this was finally resolved by my registrar. They did not tell me what they tweaked, and I don't have a specific record of the changes I attempted vs. their setting in my control panel.
I may have failed to properly designate www.***.com as the subdomain of the root domain ***.com so the redirect was not working properly.

It is not really duplicate content, but a redirection to a true subdomain. Just as if the subdomain was search.***.com
Reply With Quote Quick reply to this message
Please register to post and access all features of our very popular forum. It is free and quick. Over $68,000 in prizes has already been given out to active posters on our forum. Additional giveaways are planned.

Detailed information about all U.S. cities, counties, and zip codes on our site: City-data.com.


Reply
Please update this thread with any new information or opinions. This open thread is still read by thousands of people, so we encourage all additional points of view.

Quick Reply
Message:


Over $104,000 in prizes was already given out to active posters on our forum and additional giveaways are planned!

Go Back   City-Data Forum > General Forums > Science and Technology > Internet
Similar Threads

All times are GMT -6. The time now is 07:04 PM.

© 2005-2024, Advameg, Inc. · Please obey Forum Rules · Terms of Use and Privacy Policy · Bug Bounty

City-Data.com - Contact Us - Archive 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37 - Top