简体   繁体   中英

emberjs app using apache and php with sub directories

I have an ember application running on apache/php

Here are my routes:

App.Router.map(function(){
    this.route('homes');
    this.route('rentals');
    this.route('about');
    this.route('contact');
    this.resource('account',function(){
        this.route('profile');
        this.route('users');
        this.route('post');
    });
});

And here is my .htaccess file:

RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ /index.php#$1 [L]

Clicking on my navigation to go to account and then clicking on the sub nav to go to profile works just fine:

mydomain.loc/account/profile

However, when I click reload on that url, I get this error:

SyntaxError: syntax error
    <!DOCTYPE html>

I'm guessing because my .htaccess is not configured right to do subdirectories with emberjs correctly? Any ideas?

Simple solution... the reason for the error is that the paths in the script tags were relative. For example: js/libs/jquery-1.10.2.js the fix was simply to change it to: /js/libs/jquery-1.10.2.js

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM