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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T04:41:50+00:00 2026-05-28T04:41:50+00:00

I am deploying a CMS I developed on my computer to my first domain

  • 0

I am deploying a CMS I developed on my computer to my first domain server and I am running into issues with redirecting to pages in PHP (works in javascript) using a function that calls:

    header("Location: {$location}");

Everything works properly on my home machine through WAMP. But after I deployed on the server it is redirecting to a blank page. I have tested the issue in a separate file and found that it WORKS as long as only the file that contains the redirect_to function is included, so it looks like this:

    <?php //require_once("includes/session.php");?>
    <?php require_once("includes/functions.php");?>
    <?php //require_once("includes/constants.php"); ?>
    <?php //require_once("includes/connection.php"); ?>
    <?php 
        define("DB_SERVER", "mysite.ipagemysql.com");
        define("DB_USER", "root");
        define("DB_PASS", "notreal");
        define("DB_NAME", "myCMS");

        redirect_to("login.php");
        phpinfo();
     ?>

This is the redirect function I have defined in functions.php:

     // redirects the user to the page/path specified by $location
     function redirect_to($location){
         if($location != NULL){
             header("Location: {$location}");
             exit();
          }
     }

Notice that I can only include the functions.php file, if I include any other the redirect no longer works, just goes to a blank page… I can copy the code that was in the included files into this file like I did above with the constants.php file which looks like this:

     <?php

            // Database constants
        define("DB_SERVER", "mysite.ipagemysql.com");
        define("DB_USER", "root");
        define("DB_PASS", "notreal");
        define("DB_NAME", "myCMS");
     ?>

I CAN load all the CMS pages regularly from the Domain server, access the DB and save to it. Since I can save to the DB I am assuming there are no issues with including any of the files I am testing to include because they are all needed to access the DB. The problem is purely the redirect. Everything works fine how it is set up running on my comp as localhost.

I have been looking up this issues and trying solutions all day. I have narrowed it down to the problem of not being able to include other files, but I don’t understand why and it’s only happening on the Domain server…

Any help or insight would be greatly appreciated, thanks for taking the time to read this.

  • 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-28T04:41:51+00:00Added an answer on May 28, 2026 at 4:41 am

    It might help if you turn error reporting to E_ALL for the time being. It looks like you probably have some output being sent to the browser from another included file. Often the output is easy to miss like an extra carriage return after your closing ?> tag. It is best to omit the closing tags on your included files as they aren’t necessary and will prevent accidental output.

    If you are getting unseen output this means the headers have already been sent by the time the Location header is sent so it doesn’t work.

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

Sidebar

Related Questions

Deploying an app first time with Capistrano, but having problem running the cap deploy:update
After deploying an ASP.Net application to a new server, the first user to hit
I am thinking on deploying multiple (and different) web applications on the same server
I am deploying ASP.NET and Web Service solutions to IIS for a development server.
I am deploying an application with sql server express 2008. In the prerequisites section
I am deploying Ruby On Rails apps on an Amazon EC2 cloud server. The
I am bin deploying a MVC 3 site... it works fine on our 'Staging'
I'm part of a development team that works on many CMS based projects, using
When deploying or starting websphere aplication server this happens : Failed to create temporary
Lately I've been having issues deploying my applications in-house (enterprise developer program) with reports

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.