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 8850217
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T12:51:00+00:00 2026-06-14T12:51:00+00:00

UPDATE: OK, Tesla (user) solved most of this with a php snippet (down below),

  • 0

UPDATE: OK, Tesla (user) solved most of this with a php snippet (down below), so my remaining question is what to do with this piece of code in public_html .htaccess:

# BEGIN WordPress
  <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /
    RewriteRule ^index\.php$ - [L]
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /index.php [L]
  </IfModule>

 # END WordPress

Index.php in public_html is currently what loads wordpress.

Index2.php is my new site. I so badly want to rename it index.php so I can launch the new site. But I’m a bit confused as to what goes where.


My (original) question: I want it so that when you go to http://www.mysite.com, if you’re using webkit it’ll load the webkit-only site. But if you’re running IE or Opera or whatever else, you get taken to http://www.mysite.com/wordpress

I’m losing my mind trying to figure this out.

I’ve posted about this elsewhere, and gotten some good answers, but I’m still running up against a brick wall with this.

I have a wordpress site installed, working perfectly, but I hate wordpress, mostly because it reloads the whole site on every click, plus it feels “heavy” in general.

Anyway I built a new site, but I suck at cross-browser friendliness so for the time being it’s a webkit-only site, which I’m actually totally fine with that. It’s a very slick one-page site that loads in various associated pages via ajax. It has tons of animations, smooth-scrolling, etc. and I’m really &*^% happy with it.

So again, I want it so that when you go to http://www.mysite.com, if you’re using webkit it’ll load the new webkit-only site. But if you’re running IE or Opera or whatever else, you get taken to http://www.mysite.com/wordpress

I keep trying to figure this out but I’m gonna have a heart attack doing it. I keep making mistakes (I’m not a PHP programmer). I hate doing server-level stuff because it means I gotta take the site offline, and then play around with what feels like life-or-death.

What I need is a step-by-step walkthrough on precisely what to do, every step of the way, until the goal of having http://www.mysite.com (webkit-only) plus http://www.mysite.com/wordpress (for all other visitors) is achieved.

Someone from this site gave me this snippet, and it works great:

(Placed in root index.php)

<!DOCTYPE html>
<?php   

$navigator_user_agent = ' ' . strtolower($_SERVER['HTTP_USER_AGENT']);
if (strpos($navigator_user_agent, "webkit")) { 
?>

//page goes here (html, jquery, content etc.) Then, all the way at the bottom:

<?php
} else {

    header('Location: www.mysite.com/wordpress'); //redirects user to the given location
  }
?>

It works like a charm. Webkit gets the new site, and opera, IE, etc., end up getting sent to that URL.

The problem is wordpress also wants to use a file in root called index.php.

The next problem is how to modify the htaccess correctly, so that it doesn’t conflict with what I’m trying to do.

Look, if this is too much to ask, I’m perfectly willing to pay by the hour. I just don’t know anyone, but if someone qualified wants to get on Skype and help me do this, perhaps that would be even better than having an online discussion.

  • 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-14T12:51:02+00:00Added an answer on June 14, 2026 at 12:51 pm

    Pretend your site is this

    <html>
      <head>
        //stuff here
      </head>
      <body>
        //stuff here
      </body>
    </html>
    

    Add to the top of that file the following

    <?php   
    if (strpos(strtolower($_SERVER['HTTP_USER_AGENT']), "webkit") === false) { 
      header('Location: www.mysite.com/wordpress'); //redirects user to the given location
      exit;
    }
    ?>
    

    So now you have

    <?php   
    if (strpos(strtolower($_SERVER['HTTP_USER_AGENT']), "webkit") === false) { 
      header('Location: www.mysite.com/wordpress'); //redirects user to the given location
      exit;
    }
    ?>
    
    <html>
      <head>
        //stuff here
      </head>
      <body>
        //stuff here
      </body>
    </html>
    

    Save this file as index.php in public_html.

    Your wordpress site should be moved to public_html/wordpress

    Everything should work after that

    EDIT: As for your updated question, move the .htaccess to public_html/wordpress as well, all thats in there is for wordpress. In the public_html folder you can create a blank .htaccess or just have none for now untill you need one for mysite.com.

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

Sidebar

Related Questions

Update: The index.php file here: /public_html/d/index.php includes: /public_html/d/core/source/class.File1.php This Class.File1.php here has this include
Update: Solved, with code I got it working, see my answer below for the
UPDATE I solved my own question. See below. I made a site with bootstrap
UPDATE: I made a mistake in my debugging - this question is not relavent
Update 2018 : This question was asked long before PostCSS existed, and I would
UPDATE The second after I posted this question, thanks to the syntax highlighting of
UPDATE This is an old question for an old version of Xcode. It turned
UPDATE: I found a Scipy Recipe based in this question! So, for anyone interested,
Update: Check out this follow-up question: Gem Update on Windows - is it broken?
UPDATE: It looks like my 13.0.1 is calling code from this diffed CharMatcher. http://code.google.com/p/guava-libraries/source/diff?spec=svn69ad96b719d7cd3d872a948d7454f17b816a21c2&r=464b0cfab7c3b6713c35e6f3ae7426542668c77b&format=side&path=/guava/src/com/google/common/base/CharMatcher.java

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.