Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8142457
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T12:49:41+00:00 2026-06-06T12:49:41+00:00

Ok, so I have to do some work on a client site – and

  • 0

Ok, so I have to do some work on a client site – and for some reason, they have both the www. subdomain and the empty subdomain in use, with different websites. They do NOT want this.

They want the www. subdomain ONLY (that is, they want the empty subdomain to redirect to www.)

That’s how it is set up in WordPress, supposedly.

Here’s my .htaccess file:

# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteRule ^(.*)(\.htm|\.html)$ /contact [R=301,L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>

# END WordPress

#php_flag display_errors on
#php_value error_reporting 8191

Can anyone interpret this? (I am not very familiar with .htaccess files – anyone who has any resources on them would be helpful). How do I make it so that anyone going to http://examplesite.com goes to http://www.examplesite.com, for example.

How are there two different websites on the same domain? I’m looking in the public_html folder and there appears to be NO reference to the other site at all – nothing, no files, nada.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-06T12:49:42+00:00Added an answer on June 6, 2026 at 12:49 pm

    To force using www subdomain, you can add this code :

    RewriteCond %{HTTP_HOST} ^domain\.com$
    RewriteRule ^(.*) http://www.domain.com/$1  [QSA,L,R=301]
    

    Here is what those line does :

    1. Check the HTTP_HOST, which must be domain.com
    2. Take the current request and add it after www.domain.com/ ($1 represents the request caught)
    3. Use the generated url as a 301 redirection (permanent redirection) with [R=301] tag
    4. Doesn’t read next rules if this one is caught, with [L] tag
    5. Forward GET datas, with [QSA] tag.

    You must put this code after those two lines :

    RewriteEngine On
    RewriteBase /
    

    Which set the Rewrite engine on, and define the base url.

    Be careful : redirection doesn’t forward POST datas. Be sure alwayse use www subdomain in your code (this can easily be done using a centralized base_url).

    Have a look here to understand better htaccess files.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have some existing custom Excel workbooks/applications with code-behind C#, which work fine. They
I just began work on this site for a client, the site is www.kingcharltonmusic.com.
I have some daily analytics-style records that track usage on my site, and they
Here is the situation: Some pages on my site use different js files than
I'm trying to use a command-line client to automate some work on an ASP.NET
I'm onto problem 245 now but have hit some problems. I've done some work
I have some tabs using jQuery UI which work just fine, but I want
I have some experience in ASP.Net and can work my way around it without
I have some CSS style that does not work in IE and that works
I do some work for a company and we have an idea. What we'd

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.