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 3660644
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T01:13:36+00:00 2026-05-19T01:13:36+00:00

My web host points my main domain name to the root www folder. The

  • 0

My web host points my “main” domain name to the root www folder. The web files for that site are located in the “www/app/webroot” folder. I currently have the site up and running using the following in the htaccess file:

RewriteBase /
RewriteEngine on
RewriteRule    ^$ app/webroot/    [L]
RewriteRule    (.*) app/webroot/$1 [L] 

I’m trying to start a dev site for the same site. I made a folder named “dev” in the www folder. So, the web files for this folder are in: “www/dev/app/webroot” I have a sub-domain pointing to the dev folder. When I use the same htaccess as above in the dev folder, it doesn’t work because (I believe) it is inheriting the settings from the root www folder. When the page loads, it just comes up blank. How do I set up my htaccess files to allow for both sites?

Thanks in advance for any help! I’m obviously a novice at this stuff.

  • 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-19T01:13:36+00:00Added an answer on May 19, 2026 at 1:13 am

    So we’ll try to clean the things 🙂

    Avoid using .htaccess. All the settings in a .htaccess in a directory /foo/bar can be set in apache configuration as a Directory setting (.haccess is usefull if you provide limited access on apache conf, if you own the server don’t use it).

    <Directory /foo/bar>(...)</Directory>
    

    Then you can access your sites with named based virtualhosts. Verify you have this option:

    NameVirtualHost *:80
    

    When you have it nice things can start.
    This will be your virtualhost for your 1st app:

    <VirtualHost *:80>
        ServerName app
        ServerAlias www.app.somwhere.com
        ServerAlias app.somwhere.com
        DocumentRoot /www/app/webroot
        <Directory />
            Options FollowSymLinks
            AllowOverride None
        </Directory>
        <Directory /www/app/webroot>
            Options Indexes FollowSymLinks
            # this prevent.htaccess reading, remove if you want .htaccess
                AllowOverride None
                # allow web access 
            Order allow,deny
            allow from all
        </Directory>
    </VirtualHost>
    

    Most apache settings can be define here. Only for your 1st app. Apache will serve this configuration for all requests done for the site name ‘app’, or ‘www.app.somwhere.com’, or ‘app.somwhere.com’. You can define a lot of alias(ServerAlias)., and only one name (ServerName).

    Then if you go in your browser and type http://app/ your browser won’t find the server, so set it in your /etc/hosts. This is what every people wanting to access your app should have in the hosts file until you get a real DNS (assuming your 1st app is app.somwhere.com and the second foo.somwhere.com and 92.128.52.226is your external IP):

    127.0.0.1 app.somwhere.com app foo foo.somewhere.com
    92.128.52.226 app.somwhere.com app foo foo.somewhere.com
    

    And now let’s add another virtualhost for your second app:

    <VirtualHost *:80>
        ServerName foo
        ServerAlias www.foo.somwhere.com
        ServerAlias foo.somwhere.com
        DocumentRoot /www/foo/webroot
        <Directory />
            Options FollowSymLinks
            AllowOverride None
        </Directory>
        <Directory /www/foo/webroot>
            Options Indexes FollowSymLinks
            # this prevent.htaccess reading, remove if you want .htaccess
                AllowOverride None
                # allow web access 
            Order allow,deny
            allow from all
        </Directory>
    </VirtualHost>
    

    And etc.
    Don’t forget to restart your apache. No rewrite rule. nice virtualhosts is the 1st step of a nice configuration, you will be able to define rules, directory or location specific things per name used. Even php configuration can be set per virtualhost with php_value instead of a global shared one on php.ini.

    type

    apache2 -S
    

    to get the list of your virtualhosts, you’ll see that the first one is the ‘default’ one, if apache does’nt understand the name of the requested site it will serve this default one (so you could ad a specific virtualhost on top to handle theses cases).

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to host a PHP web site that was given to me. I
My former roommate agreed to host my web site for a while on his
We want to build a web application, that is specific to our domain, but
I have a new web app that is packaged as a WAR as part
I am getting a web host and i have projects with teammats. I thought
Can anyone recommend a framework or basic technology to use to host a web
I'm trying to host a python script using an apache web server, but the
http://www.codeplex.com/IIRF/Thread/List.aspx My webhost installed IIRF for me and I am convinced that they did
Web applications that want to force a resource to be downloaded rather than directly
I built a LAMP web application that let's users create their own profile page

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.