|
|
|
.htaccess files are used to modify the Apache configurations of each app
|
|
|
|
|
|
|
|
Instead of having a .htaccess file at the top level of your app, you should:
|
|
|
|
|
|
|
|
1. have a `public/.htaccess.development` and `public/.htaccess.passenger_fix` in your app versioned
|
|
|
|
2. have the `.htaccess` file be in `public/.htaccess`, created by executing this command
|
|
|
|
|
|
|
|
```
|
|
|
|
cat .htaccess.development .htaccess.passenger_fix > .htaccess
|
|
|
|
```
|
|
|
|
|
|
|
|
The `public/.htaccess` file should be in `.gitignore` (a different one is generated when deploying a shared app).
|
|
|
|
|
|
|
|
The purpose of the `.htaccess.passenger_fix` is to force the redirect from a request to the root of the app to an appropriate suburi of the app. When deploying a shared app, the AweSim CLI will include the `.htaccess.passenger_fix` in the custom .htaccess file that is required for the shared app to work.
|
|
|
|
|
|
|
|
In Container Fill Sim's case it is `/containers`, so I have
|
|
|
|
|
|
|
|
efranz@oakley01:~/awesim_dev/rails1/public (master)$ cat .htaccess.passenger_fix
|
|
|
|
RewriteEngine On
|
|
|
|
RewriteBase /
|
|
|
|
RewriteCond %{REQUEST_URI} ^(.*)$
|
|
|
|
RewriteRule ^$ %1containers [L]
|
|
|
|
|
|
|
|
If you want to change the default sub-uri you must change the last directive `RewriteRule ^$ %1containers [L]` as well.
|
|
|
|
|
|
|
|
`.htaccess.development` should contain the directives only to be used in development mode. In this case the minimum required is:
|
|
|
|
|
|
|
|
efranz@websvcs02:~/awesim_dev/rails1 (master)$ cat public/.htaccess.development
|
|
|
|
RailsEnv development |