apache - Using .htaccess to make subdirectory act like subdomain -


it's little difficult me ask question correctly in title, here's i'm trying figure out.

if use .htaccess on website , i'm trying create specific path "redirect" inside path uses it's non-redirected path it's relative path. sorry structure of sentence.

so example...

i have website as-

http://www.example.com/ 

i want keep things organized create sub-folder/subdirectory keep these folders inside of.

http://www.example.com/projects/ 

so folder projects place holder future projects , want create folder inside projects each project, can define url each 1 such...

http://www.example.com/superfish/ http://www.example.com/aquafear/ 

now folder superfish , aquafear under http://www.example.com/projects/ in own folder say...

http://www.example.com/projects/01/ http://www.example.com/projects/02/ 

now it'd fine , dandy keep links such, memory purposes , share other people links projects, i'd create nice simpler url custom "name". http://www.example.com/superfish/ instead of http://www.example.com/projects/01/.

now able partially .htaccess file in root folder code...


rewriteengine on options +followsymlinks  rewriterule    ^superfish/?$    projects/01/    [nc,l] rewriterule    ^aquafear/?$     projects/02/    [nc,l] 

the issue though can't use relative paths superfish or aquafear made url links. such .css, .js, .etc... isn't within scope because it's trying files through made url rather real physical one.

so question is, how make can use made url , have webpage load things real physical path or somehow fix relative paths doing within .htaccess file?

the reason titled way is, due subdomains being able find files relative paths though they're subdirectory same.

using final $ blocks files inside 2 folders being redirect correctly. tried instead :

rewriteengine on options +followsymlinks  rewriterule    ^superfish/?(.*)$    projects/01/$1    [nc,l] rewriterule    ^aquafear/?(.*)$     projects/02/$1    [nc,l] 

Comments

Popular posts from this blog

java - Intellij Synchronizing output directories .. -

git - Initial Commit: "fatal: could not create leading directories of ..." -