Webmaster Forum

Go Back   Webmaster Forum > Web Development > Coding Forum

Coding Forum Problems with your code? Discuss coding issues, including JavaScript, PHP & MySQL, HTML & CSS, Flash & ActionScript, and more.


Reply
 
Thread Tools Display Modes
Share |
  #1  
Old 02-04-2015, 11:16 AM
NickCUK NickCUK is offline
Junior Member
 
Join Date: 05-22-11
Posts: 25
iTrader: 0 / 0%
How to redirect website

Not sure this is the correct forum but none of the others seemed appropriate either so thought I would start here.

My task is to redirect a current website to a new page which then links back to the customers existing website. I can change DNS records to point to the new hosting server but problem is how to redirect from there back to their existing website.

Problem is their existing website only works when it is called using the domain name, do an nslookup on the domain name and try and use the ip number to access it fails with 'You don't have permission to access / on this server.' I guess it is probably hosted on some sort of VPS which operates using the URL in the header.

Any suggestions how I can do this redirection.
 
Reply With Quote

Advertisement

Advertisement

  #2  
Old 02-05-2015, 12:23 PM
Umar farooque khan Umar farooque khan is offline
Banned
 
Join Date: 02-05-15
Location: delhi
Posts: 30
iTrader: 0 / 0%
redirect website using htaccess

Redirect 301 / your-new-url

Use the above code, in your htaccess file to redirect your complete website to the another website.
 
Reply With Quote
  #3  
Old 02-06-2015, 04:42 AM
NickCUK NickCUK is offline
Junior Member
 
Join Date: 05-22-11
Posts: 25
iTrader: 0 / 0%
Yea but I don't have control of the existing website or server, all I can do is change the DNS to point to our new server.

Say domain is MyDomain.com. I change DNS to direct MyDomain.com to the new server. New server has a page which links back to old server by IP number. However this doesn't work because old server seemingly needs to use MyDomain.com rather than an IP number I guess because it is on a VPS.
 
Reply With Quote
  #4  
Old 02-06-2015, 10:19 PM
HTMLBasicTutor's Avatar
HTMLBasicTutor HTMLBasicTutor is offline
Administrator
 
Join Date: 10-29-07
Location: Canada
Posts: 26,707
iTrader: 5 / 100%
Quote:
Originally Posted by NickCUK View Post
Yea but I don't have control of the existing website or server
Why don't you have access to these?
 
Reply With Quote
  #5  
Old 02-06-2015, 11:28 PM
voodooKobra's Avatar
voodooKobra voodooKobra is offline
Contributing Member
 
Join Date: 09-04-13
Location: Florida
Posts: 79
iTrader: 0 / 0%
It sounds like you have some resources on the old server that you would like to serve on the new server, both from the same exact domain name?

I would suggest either taking inventory of those resources and set up a caching reverse proxy, or take the time to migrate the data over to its new home.
 
Reply With Quote
  #6  
Old 02-07-2015, 12:27 AM
J. H. Rasmussen J. H. Rasmussen is online now
Super Moderator
 
Join Date: 11-11-11
Location: Copenhagen, Denmark
Posts: 5,998
iTrader: 1 / 100%
Why not make a cname dns record to point the old domain to the new one, then you could probably make some redirect .htaccess code on the new server if the urls on the old server is different from the urls on the new server.
 
Reply With Quote
  #7  
Old 02-09-2015, 03:30 AM
J. H. Rasmussen J. H. Rasmussen is online now
Super Moderator
 
Join Date: 11-11-11
Location: Copenhagen, Denmark
Posts: 5,998
iTrader: 1 / 100%
Quote:
Originally Posted by webtechnocrazy View Post
Try htacces if server is on appache or web.conf if it is in IIS
Did you read beyond the title of the thread? Try to read the opening post and its replies, then come back with an on-topic reply.
 
Reply With Quote
  #8  
Old 02-09-2015, 06:58 AM
ScriptMan's Avatar
ScriptMan ScriptMan is online now
Super Moderator
 
Join Date: 02-10-07
Location: Central Kentucky
Posts: 14,019
iTrader: 4 / 100%
Very few shared servers will allow this:
Quote:
try and use the ip number to access it fails with 'You don't have permission to access / on this server.' I guess it is probably hosted on some
and there is a valid reason why.
 
Reply With Quote
  #9  
Old 02-15-2015, 09:42 AM
NickCUK NickCUK is offline
Junior Member
 
Join Date: 05-22-11
Posts: 25
iTrader: 0 / 0%
Quote:
Originally Posted by voodooKobra View Post
and set up a caching reverse proxy,
Now that is an interesting possibility.

Question is can reverse proxy be configured without having access to the old webserver? Perhaps by changing the public DNS for the domain to the new server which then retrieves pages from the old server using it's (new server) local DNS to point MyDomain.com to the IP number of the old server.
 
Reply With Quote
  #10  
Old 03-25-2015, 06:45 AM
NickCUK NickCUK is offline
Junior Member
 
Join Date: 05-22-11
Posts: 25
iTrader: 0 / 0%
Quote:
Originally Posted by voodooKobra View Post
set up a caching reverse proxy
This looks like the way to go, question is how do I do this?

The new webserver is a VPS running Apache on CentOS. I have access to it via Plesk control panel and via SSH logon.

The way I see it's DNS working is:
Public DNS - domain.org.uk -> new webserver
new webserver (cachiong reverse proxy)local DNS - domain.org.uk -> original webserver
Does that sound like it might work.
 
Reply With Quote
  #11  
Old 04-23-2015, 08:30 AM
NickCUK NickCUK is offline
Junior Member
 
Join Date: 05-22-11
Posts: 25
iTrader: 0 / 0%
Well tried that but doesn't work for some reason, what I have at the moment is:

/etc/hosts
Code:
xxx.xxx.xxx.xxx <domain>.org.uk
/etc/httpd/conf/httpd.conf
Code:
<VirtualHost *:80>
ProxyPreserveHost On ServerName www . <domain>.org.uk ServerAlias domain ProxyHTMLLogVerbose On LogLevel Info ErrorLog /var/log/httpd/domain-error_log TransferLog /var/log/httpd/domain-access_log <Location />
ProxyPass http: //<domain>.org.uk/ ProxyPassReverse http: //<domain>.org.uk/ Order allow,deny Allow from all
</Location>
</VirtualHost>
but proxy is not working and nothing in Error or Transfer logs.

Last edited by NickCUK; 04-23-2015 at 08:33 AM.
 
Reply With Quote
Go Back   Webmaster Forum > Web Development > Coding Forum

Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Redirect or remove link on website? minhtam SEO Forum 3 09-03-2013 06:53 AM
redirect.ar virus in code in website cluny Coding Forum 6 05-18-2013 10:25 AM
How to Redirect or Remove my old urls of the same website? rizecorp SEO Forum 9 02-03-2012 03:46 AM
redirect subdomain to a website FilesCash.NET Coding Forum 1 03-23-2010 10:06 AM


V7N Network
Get exposure! V7N I Love Photography V7N SEO Blog V7N Directory


All times are GMT -7. The time now is 05:47 AM.
Powered by vBulletin
Copyright 2000-2014 Jelsoft Enterprises Limited.
Copyright © 2003 - 2018 VIX-WomensForum LLC