TalkPHP
 
 
Account Login
Latest Articles
» The basic usage of PHPTAL, a XML/XHTML template library for PHP
» Vulnerable methods and the areas they are commonly trusted in.
» Simple way to protect a form from bot
» The Basics On: How Session Stealing Works
» How to keep your forms from double posting data
IRC Channel
IRC Speech Bubble Join the friendly bunch on IRC...
(#TalkPHP on Freenode)

...Also available via a web interface.

See this thread for information on the TalkPHP Free Hugs Initiative™. Subject to availability.
Associates
Associates
CSS Tutorials
Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old 10-07-2009, 01:28 PM   #1 (permalink)
Jmz
The Acquainted
 
Join Date: Oct 2007
Location: Newcastle, UK
Posts: 113
Thanks: 3
Jmz is on a distinguished road
Default Redirecting site to temporary folder

I'm going to be updating one of my sites soon. The new site will be running on WordPress and I'd like to redirect users to a temporary site I have made while I get everything set up for my new site.

The temporary site is located in a folder called temp. I tried using htaccess to redirect anyone that goes to mydomain.com to mydomain.com/temp. My .htaccess file looks like this:

Code:
DirectoryIndex test.php
That sends them to test.php which then redirects them to mydomain.com/temp using a 301 redirect.

However, now I have installed WordPress in the root folder of my domain even if I go to mydomain.com/index.php I am still redirected to the temp folder.

What is the best way to do this so that I can still work on my site whilst users are redirected to the temp site
__________________
Free CSS Tutorials
Send a message via MSN to Jmz
Jmz is offline  
Reply With Quote
Old 10-07-2009, 01:57 PM   #2 (permalink)
The Contributor
 
ioan1k's Avatar
 
Join Date: Mar 2009
Location: US
Posts: 76
Thanks: 0
ioan1k is on a distinguished road
Default

Easiest thing to do ....

Keep the old site in the root directory and develop and test your new one in something like /dev or on a subdomain dev.domain.com, once everything works then move it over to the root :)

It's much easier than trying to redirect this and that way and when its time to migrate you only need to update a few settings in wordpress, instead of messing around with htaccess
__________________
My Portfolio - Work - Need freelance Work?
I've been developing 5 years now, and I learn something new everyday
ioan1k is offline  
Reply With Quote
Old 10-07-2009, 06:50 PM   #3 (permalink)
Jmz
The Acquainted
 
Join Date: Oct 2007
Location: Newcastle, UK
Posts: 113
Thanks: 3
Jmz is on a distinguished road
Default

Thanks, I was hoping there would be a simple way with .htaccess.

I'll just do it your way
__________________
Free CSS Tutorials
Send a message via MSN to Jmz
Jmz is offline  
Reply With Quote
Old 10-07-2009, 10:19 PM   #4 (permalink)
The Addict
 
Join Date: May 2009
Posts: 287
Thanks: 5
adamdecaf is on a distinguished road
Default

Here is what I do.

Currently I host more than one site on the same server so this is my structure.

Code:
/
/SITE_1/
  /BLOG/ <-- blog.example.com
  /SITE/ <-- The main directory for .example.com
/SITE_2/
 /BLOG/  <-- blog.example.net
 /SITE/  <-- .example.net
What I suggest doing is something like this.

Code:
/
/SITE/
  /BLOG/ <-- blog.example.com
  /SITE/ <-- The main directory for .example.com
  /NEW/ <-- dev.example.com
Then when you're ready to change over just delete /SITE/ and rename /NEW/ -> /SITE/ and you will be fine. The downtime should be under a minute.
__________________
My Site
adamdecaf is offline  
Reply With Quote
Old 10-08-2009, 01:51 PM   #5 (permalink)
Jmz
The Acquainted
 
Join Date: Oct 2007
Location: Newcastle, UK
Posts: 113
Thanks: 3
Jmz is on a distinguished road
Default

That's a pretty good idea :)

How do you tell the server to use the 'site' folder as the main folder? htaccess?
__________________
Free CSS Tutorials
Send a message via MSN to Jmz
Jmz is offline  
Reply With Quote
Old 10-08-2009, 10:22 PM   #6 (permalink)
The Addict
 
Join Date: May 2009
Posts: 287
Thanks: 5
adamdecaf is on a distinguished road
Default

Quote:
Originally Posted by Jmz View Post
That's a pretty good idea :)

How do you tell the server to use the 'site' folder as the main folder? htaccess?
If you use a hosting panel then inside the "Domains" section there should be a spot to tell each domain (and subdomain) where to located the root directory on the file server.

If you're trying to do it directly on the Apache HTTP web server then you will need to edit the httpd.conf or vhosts.conf file and change the VirtualHosts. If you run into and issues there are many people here who can answer any questions about the VirtualHosts (or Control Panel).
__________________
My Site
adamdecaf is offline  
Reply With Quote
Old 10-09-2009, 07:49 AM   #7 (permalink)
Jmz
The Acquainted
 
Join Date: Oct 2007
Location: Newcastle, UK
Posts: 113
Thanks: 3
Jmz is on a distinguished road
Default

I'm using plesk but I'm not sure how to change the default folder, or even if it's possible.

I have a few sites on the same server so I need to make sure anything I change only changes for this account.
__________________
Free CSS Tutorials
Send a message via MSN to Jmz
Jmz is offline  
Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
How to create a gallery class Tanax Advanced PHP Programming 25 02-19-2013 04:25 AM
How to make an RSS aggregator site ? vuthcam Advanced PHP Programming 1 02-03-2009 10:12 PM
How to Login to Any Account on an Insecure Site Wildhoney Tips & Tricks 18 12-14-2008 09:58 PM
Gaming Site Redux obolus Show Off 3 02-25-2008 09:52 PM
Recently rebuilt site obolus Show Off 6 10-30-2007 02:24 AM


All times are GMT. The time now is 04:21 PM.

 
     

Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0
Inactive Reminders By Icora Web Design