LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 07-01-2014, 08:06 AM   #1
noguru
LQ Newbie
 
Registered: Sep 2012
Posts: 15

Rep: Reputation: Disabled
Apache redirect?


I have a slightly different problem: I want requests for:
mysite.com
to go to:
mysite.com/thisdir

I don't want to use a re-direct as this should be transparent to the user.
I tried:
alias / /thisdir
but that caused an error: "Forbidden, you do not have access to /" and blocks ALL accesses to my site.

Does anyone have a method for this?
 
Old 07-03-2014, 03:32 AM   #2
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974
Just change the DocumentRoot to look elsewhere, there's no need to redirect.

Please do not drag up dead threads. it gets very confusing very quickly.
 
Old 07-03-2014, 06:11 PM   #3
Tinkster
Moderator
 
Registered: Apr 2002
Location: in a fallen world
Distribution: slackware by choice, others too :} ... android.
Posts: 23,066
Blog Entries: 11

Rep: Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910
Post & response split-out of unrelated OLD thread, and moved to Newbie.
 
Old 07-03-2014, 10:13 PM   #4
btmiller
Senior Member
 
Registered: May 2004
Location: In the DC 'burbs
Distribution: Arch, Scientific Linux, Debian, Ubuntu
Posts: 4,275

Rep: Reputation: 370Reputation: 370Reputation: 370Reputation: 370
Another option is to use mod_rewrite -- if you Google for mod_rewrite you will find it's documentation.
 
Old 07-04-2014, 09:31 AM   #5
noguru
LQ Newbie
 
Registered: Sep 2012
Posts: 15

Original Poster
Rep: Reputation: Disabled
I apologize for posting to a dead thread. I couldn't find a live one with this topic. The solutions posted do not solve my problem, but I did find a REALLY simple one (see below).

My website has 4 entry points:

0. mysite provides a simple "home page" that provides links to "sites" 1 and 2 below
1. mysite/Pix sends users directly to an index list of programs to run. They don't have to add the /~me/somefolder. Also, due to other considerations, /Pix is outside Public_html
2. mysite/~me sends users to my regular site (homepage, links, etc)
3. mysite/subdir sends users to my development site (using index.php, etc.) built with Drupal

My primary concern was to be able to export "site" 3, as-is, to a production server, leaving all links relative to the subdirectory the files are in. This way both systems use the exact same link structure and don't interfere with "sites" 1 & 2. I suspect that this may not be the "best" way to do what I wanted, but it is what I came up with.

A redirect would not be transparent on the production system.
Changing Document Root would break my other "sites".

I realized, the day after posting my original question, that I had a simple solution for the production site: I created a simple public_html/index.html file with a one-line JavaScript program: window.location.href= "/subdir"; That causes the index.php to load and it works well.
 
Old 07-04-2014, 01:58 PM   #6
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974
the live thread is the one that YOU start yourself.
 
Old 07-05-2014, 07:29 AM   #7
noguru
LQ Newbie
 
Registered: Sep 2012
Posts: 15

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by acid_kewpie View Post
the live thread is the one that YOU start yourself.
If I started a thread with a topic that someone was already posting to, wouldn't that be as bad as posting to a dead thread? Responses would be split across 2 sets of postings, making it hard for anyone to follow logically and maybe not even find the answer they want. I was TRYING keep my posting with a topic appeared TO ME to be relevant. As it turns out, it isn't really a Linux question.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] Apache Redirect wizard210 Linux - Server 5 10-19-2010 03:30 PM
Redirect https apache requests to folder not in apache root bax Linux - Enterprise 4 04-12-2010 02:16 PM
Apache Only allow certain IP's and redirect others chenxiaolong Linux - Server 2 08-15-2009 12:12 AM
apache redirect mahmoud Linux - Newbie 3 01-13-2009 09:59 PM
apache redirect? fibbi Linux - Software 7 01-30-2004 11:41 PM


All times are GMT -5. The time now is 03:46 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration