Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7659351
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T13:19:17+00:00 2026-05-31T13:19:17+00:00

I have a domain (let the name be) mydomain.com . I added a subdomain,

  • 0

I have a domain (let the name be) mydomain.com.
I added a subdomain, sub.mydomain.com. (It’s an other site, the two sites don’t have anything to do with each other)

I have mapped the subdomain (with godaddy.com’s tool) to /sub directory. It works well with static file paths, ex. http://sub.mydomain.com/js/script.js.php.
However, I would like to be able to use the rewrite module to get http://sub.mydomain.com/js/script.js

My .htaccess files:

.htaccess in the root directory:

RewriteEngine On
RewriteCond %{HTTP_HOST} ^sub.mydomain.com$
RewriteRule ^.*$ http://mydomain.com/sub%{REQUEST_URI} [L,P]

.htaccess in the /sub directory:

RewriteEngine on
RewriteRule ^js/script\.js$ js/script.js.php [L]

(I tried adding RewriteBase /sub/, I didn’t succeed).
It seems as if Apache didn’t notice the /sub‘s .htaccess

How can I get the rewrite work on the subdomain’s paths?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-31T13:19:18+00:00Added an answer on May 31, 2026 at 1:19 pm

    SOLVED!

    After a long, exhausting debugging and googling I found an Apache setting that made the trouble:

    I added Options -MultiViews and voilá, it works!

    /////////////////////////////////////////////

    Now my configuration:

    -no .htaccess in the root.

    -.htaccess in the root/sub:

    DirectoryIndex site/index.php
    Options -MultiViews
    RewriteEngine on
    RewriteRule ^site/js/script.js$ /site/js/script.js.php [L]
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have domain site.com and there is subdomain sub.site.com Once you open sub.site.com you
I have a site on a domain, let's call it mydomain.com , where people
For argument sake, let's pretend: My domain name is mydomain.com I have subdomains such
We have a web site in the domain, let's name: http://website.com . It is
Let's say my domain name is website123.com and I have a subdomain of my.website123.com
Let's say I have a domain, js.mydomain.com , and it points to some IP
I have a client. Let's say their domain is www.mydomain.com. We are creating a
We have a domain name with various TLDs. Let's use example.com as our main
I have 10 systems hosted in the same domain let's call it (domain.com). I
Let's say I have myapp.appspot.com and two custom domains respectively called foo.com and bar.com

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.