/    Sign up×
Community /Pin to ProfileBookmark

Mod_rewrite Redirect to folder

Hey hope some one can help me out with not exactly PHP question

in Apache mod_rewrite

How can i configure it so all requests to go separte folder.

Ex
some one requests “domain.com” the request will be fowarded to domain.com/files/

yet i have other folders like domain.com/other_domain/ that should not be touched in any way?

Hope some one can hel me out tnx!

to post a comment
PHP

2 Comments(s)

Copy linkTweet thisAlerts:
@Jarrod1937Apr 29.2010 — If the domain will always redirect to that subdirectory, i would then just make a static apache redirect and not worry about pattern matching.
Copy linkTweet thisAlerts:
@alexusauthorApr 29.2010 — well problem is that i have multiple domains hosted on the same server and main domain files go to 1st directory. All other domains have the folder in 1st directory

ex:

maindomain.com has files in [$root/]

2nddomain.com has files in [$root/2nddomain/]

3rddomain.com has files in [$root/3rddomain/]

so now i want to use my maindomain to host site under it but i dont want to mess up with all other domains so i wanted to move that domain to: [$root/maindomain/]

Yet, I want to be able to access folders like maindomain.com/3rddomain/ (that would load the same page as if i go to 3rddomain.com)

I hope i explainded what I need


But what is the best way to do this i dont know ?
×

Success!

Help @alexus spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 4.29,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,

tipper: @Samric24,
tipped: article
amount: 1000 SATS,
)...