Linode Forum
Linode Community Forums
 FAQFAQ    SearchSearch    MembersMembers      Register Register 
 LoginLogin [ Anonymous ] 
Post new topic  Reply to topic
Author Message
 Post subject: Newb redirect question
PostPosted: Mon Oct 29, 2012 5:04 pm 
Offline

Joined: Mon Oct 29, 2012 4:58 pm
Posts: 1
Hey guys,

I am fairly new to the linux world and need to know how to redirect my site from:

li375-xx.members.linode.com

to

mydomain.com

My site is currently showing on both these domains.

I would like a 301 redirect that keeps the path intact. (li375-xx.members.linode.com/halloween would redirect to mydomain.com/halloween)

I also have wordpress installed and everything I've tried is not working. I also created a cname hoping it would redirect from li375-xx.members.linode.com to mydomain.com but no luck there also.

Can you tell me what to do and where the code should go?

I installed the stacksript: Ubuntu 10.04 LTS and 'WordPress' StackScript at revision 146

Running the LAMP stack that is.

Thanks!
Derek


Top
   
PostPosted: Tue Nov 06, 2012 8:23 pm 
Offline
Senior Newbie

Joined: Thu Jan 19, 2012 10:12 am
Posts: 6
Heya Derek,
You should be able to achieve this just by messing around with the Apache configuration a bit. If you haven't already set up virtual hosting, you should do that now. The guide here may be helpful if you run into any trouble following the instructions below:
If you haven't already set up virtual sites, then presumably you are currently using the 000default site for everything (that is to say, currently both the li375-xx.members.linode.com and the mydomain.com sites will be using the 000default site config in apache). This is fine, and we can create a new virtual site just for li375-xx.members.linode.com which will forward to the default site. To do this you'll need to do something along the lines of...
cd /etc/apache2/sites-available/
touch li375-xx.members.linode.com

At this point, edit the content of /etc/apache2/sites-available/li375-xx.members.linode.com (you can use nano li375-xx.members.linode.com) and set it to the following:
Code:
<VirtualHost *:80>
     ServerName li375-xx.members.linode.com
     Redirect 301 / http://mydomain.com/
</VirtualHost>

Save the file, and then add the site to apache and reload apache:
a2ensite li375-xx.members.linode.com
/etc/init.d/apache2 reload

That should sort you out. Give a shout if you run into any problems. I've made a few assumptions about the way you have things set up at the moment, so it may not work 100%.
Best!


Top
   
PostPosted: Tue Nov 06, 2012 9:04 pm 
Offline
Senior Member
User avatar

Joined: Sun Dec 27, 2009 11:12 pm
Posts: 1038
Location: Colorado, USA
Why would you want to use li375-xx.members.linode.com at all?

Just setup and use your real domain name.

_________________
Either provide enough details for people to help, or sit back and listen to the crickets chirp.
Security thru obscurity is a myth - and really really annoying.


Top
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic


Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
RSS

Powered by phpBB® Forum Software © phpBB Group