crsfs
asked on
Directory Issue with Apache
I have a website that I can access by going to http://www.mysite.com/mysite/index.html.
How can I fake the server into thinking that http://www.mysite.com/mysite/index.html is acutally http://www.mysite.com/index.html, without moving any of the code.
I'm using apache.
How can I fake the server into thinking that http://www.mysite.com/mysite/index.html is acutally http://www.mysite.com/index.html, without moving any of the code.
I'm using apache.
ASKER
It's a full site there, so we'd probably have to change all the references. Is this rewriting each file as it's read or is it just modifying the full url?
So in the example http://www.mysite.com/mysite/level2/index.html, etc. would be accessible from http://www.mysite.com/level2/index.html.
From other things I've looked at, it looks like this may be do-able with VirtualHosts in http.conf?
So in the example http://www.mysite.com/mysite/level2/index.html, etc. would be accessible from http://www.mysite.com/level2/index.html.
From other things I've looked at, it looks like this may be do-able with VirtualHosts in http.conf?
ASKER
sorry apache2.conf, not http.conf.
> So in the example http://www.mysite.com/mysite/level2/index.html, etc. would be accessible from http://www.mysite.com/level2/index.html.
No, not yet.
Trying to figure out the best solution...:
Are there other files/folders present (e.g. /foo) which should not go into /mysite/?
> From other things I've looked at, it looks like this may be do-able with VirtualHosts in http.conf?
If you have a separate domain or subdomain, yes.
(httpd.conf is the standard name in the distribution from apache.org, other distributors have chosen to use another name)
No, not yet.
Trying to figure out the best solution...:
Are there other files/folders present (e.g. /foo) which should not go into /mysite/?
> From other things I've looked at, it looks like this may be do-able with VirtualHosts in http.conf?
If you have a separate domain or subdomain, yes.
(httpd.conf is the standard name in the distribution from apache.org, other distributors have chosen to use another name)
ASKER
Yes, it ends up being kind of a deep structure. I'd like to access everything in " /mysite/ " as if it were just in " / ".
Essentially, the application that is exposing the content, forces the extra folder, we just want that to disappear.
Essentially, the application that is exposing the content, forces the extra folder, we just want that to disappear.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thanks a lot. I'm new to Apache, and web dev in general, so I assume I'm screwing up some of the terminology.
So, going to http://www.mysite.com will show http://www.mysite.com but will be pulling files from http://www.mysite.com/mysite/ ?
So, going to http://www.mysite.com will show http://www.mysite.com but will be pulling files from http://www.mysite.com/mysite/ ?
Yes, that's an internal rewrite which doesn't change REQUEST_URI but maps the request to another physical path (except if there's some error and /mysite/ was requested to prevent a mapping to /var/www/mysite/mysite/).
ASKER
Great. Truly a genius. Thanks for bearing with me as I learn this stuff.
Open in new window