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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T11:03:47+00:00 2026-05-23T11:03:47+00:00

I have changed my domain name and redirecting every request to new domain with

  • 0

I have changed my domain name and redirecting every request to new domain with index.php like:

<?php
// Permanent redirection
$url = "http://newdomain.com".$_SERVER['REQUEST_URI'];
header("HTTP/1.1 301 Moved Permanently");
header("Location: ".$url);
exit();
?>

also with .htaccess like:

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

I also made domain changing from Google Webmaster Tools. Should I add something or do sth more to this for better Google migration?

  • 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-05-23T11:03:47+00:00Added an answer on May 23, 2026 at 11:03 am

    It looks like you’re only redirecting requests to files/directories that don’t exist. Static files (CSS, JS, images) won’t be redirected. The following snippet will avoid PHP entirely and redirect ALL requests to your new domain:

    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteRule ^(.*)$ http://newdomain.com/$1 [R=301,L]
    </IfModule>
    

    To continue serving static files from the old domain, use:

    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule ^(.*)$ http://newdomain.com/$1 [R=301,L]
    </IfModule>
    

    Aside from redirects, make sure you update all links and file references on the new domain. You’ll want to keep the redirects online for at least a few weeks to give them a chance to settle in. I also recommend getting in touch with anyone that may be linking to your site and ask that they update their link to reflect the domain change. Google’s Webmaster Tools can help with this and identifying bad links.

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

Sidebar

Related Questions

For example I have this address: http://www.domain.com/page/ page-name page-name is always changed, by the
I have recently changed domain name for a webapp I run on Google App
I have been asked to point a new domain name to my already SSL
I have a index.php which will be loaded on many sites <?php $id=$_GET[id]; header(HTTP/1.1
I have a change tracking framework that tracks changed made to domain objects on
Been trying to see how flexible this is. http://jsfiddle.net/PJSha/4/ i have changed the get
I have decided to change all my /dyanmic.php?UID=... pages to /static/Name-From-DB . I have
here is my configuration: http://domain.com (obviously fictitious name...) hosted on a server running Apache
I have a class like this : class User { String name; String password;
I have changed the DefaultMode property of my details view to Insert since I

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.