WebFaction
Community site: login faq
0
1

Hello,

I have installed the yii2 Framework to my webfaction php application. Everything works, and if I go to http://myhost.com/basic/web/index.php the application works just fine.

Now I want to remove the "basic/web" part of the url. I followed the yii2 docs http://www.yiiframework.com/doc-2.0/guide-start-installation.html#configuring-web-servers but when I create a .htaccess file in the php application root it does not work and gives me a 500 error. Someone had mentioned that Webfaction does not allow virtualhost in .htaccess. Is there anyway around this?

Here is the code that I am wanting to use in my .htaccess:

# Set document root to be "basic/web"
DocumentRoot "path/to/basic/web"

<Directory "path/to/basic/web">
    # use mod_rewrite for pretty URL support
    RewriteEngine on
    # If a directory or a file exists, use the request directly
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    # Otherwise forward the request to index.php
    RewriteRule . index.php

    # ...other settings...
</Directory>

Thank you.

asked 28 Oct '14, 21:21

yoran15
1315
accept rate: 0%

edited 29 Oct '14, 05:07


My recommendation is that you install a "Symbolic link to Static/CGI/PHP-5.5" application from our control panel, using "/home/your_username/webapps/your_app_name/basic/web" as the symlink path, then serve that app from the root of your site.

Hope that helps!

permanent link

answered 29 Oct '14, 20:28

seanf
12.2k42136
accept rate: 37%

Thanks. I didn't know about the symbolic link app category in the applications section. Link to the relevant documentation: http://docs.webfaction.com/user-guide/websites.html#installing-applications-not-listed-in-the-control-panel

(08 Nov '14, 19:24) yoran15
Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:

×226
×75
×8
×2
×2

question asked: 28 Oct '14, 21:21

question was seen: 7,098 times

last updated: 08 Nov '14, 19:24

                              
WEBFACTION
REACH US
SUPPORT
LEGAL
© COPYRIGHT 2003-2021 SWARMA LIMITED - WEBFACTION IS A SERVICE OF SWARMA LIMITED
REGISTERED IN ENGLAND AND WALES 5729350 - VAT REGISTRATION NUMBER 877397162
5TH FLOOR, THE OLD VINYL FACTORY, HAYES, UB3 1HA, UNITED KINGDOM