Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

154
Views
subdomain to sub folder mapping

e.g. my subdomain is abc.example.com

my folder is /htdocs/abcfiles

my requirement is when i accessing the url http://abc.example.com. it will display the webpage from "abcfiles/" folder.

my .htaccess file

RewriteEngine On
RewriteCond %{HTTP_HOST} ^abc.example.com$
RewriteCond %{REQUEST_URI} !^/abcfiles/
RewriteRule (.*) /abcfiles/$1 [L]
RewriteBase /abcfiles/
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /abcfiles/index.php [L]

Its working but "/abcfiles/" showing in some links. i.e abc.example.com/abcfiles/...

over 4 years ago · Santiago Trujillo
1 answers
Answer question

0

You can have this code in site root .htaccess:

RewriteEngine On

# if /abcfiles/ is in URL then remove it
RewriteCond %{THE_REQUEST} \s/abcfiles/(\S*) [NC]
RewriteRule ^ /%1 [L,NE,R=301]

# if hostname starts with abc. then route the request to abcfiles/
RewriteCond %{HTTP_HOST} ^abc\. [NC]
RewriteCond %{REQUEST_URI} !^/abcfiles/ [NC]
RewriteRule (.*) abcfiles/$1 [L]

Have this code in abcfiles/.htaccess:

RewriteEngine On

RewriteRule ^index\.php$ - [L,NC]

# route every request to index.php
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . index.php [L]
over 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!