Dominus77 / yii2-advanced-start

Yii2 Start Project Advanced Template
https://dominus77.github.io/yii2-advanced-start/
MIT License
23 stars 12 forks source link

Translate the menu #28

Closed SwapnilAkolkar closed 5 years ago

SwapnilAkolkar commented 5 years ago

Hi it is in Russian language how can I change its language

Dominus77 commented 5 years ago

Hi, the language changes in the application configuration files: frontend: https://github.com/Dominus77/yii2-advanced-start/blob/de43ce424ab38ef23bd6bcd95ddee5a3c4a35afd/frontend/config/main.php#L38 backend: https://github.com/Dominus77/yii2-advanced-start/blob/de43ce424ab38ef23bd6bcd95ddee5a3c4a35afd/backend/config/main.php#L11

SwapnilAkolkar commented 5 years ago

I want to install it on localhost , the project works fine onle server but not on windows as it is under advanced_project folder . I am not able to edit the given .htaccess to work with localhost. can you have any suggestions ? I tried to add advanced_project folder in path befor frontend and backend entries in original htaccess.

Dominus77 commented 5 years ago

The entire project is uploaded to a folder accessible from the Internet, public_html. Files .htaccess are already configured to work correctly. In most cases, they do not change.

Or what exactly you can not?

SwapnilAkolkar commented 5 years ago

my htaccess is here c:/xampp/htdocs/advanced-project/.htaccess And thats why I am not able to run it on localhost

SwapnilAkolkar commented 5 years ago

It works perfectly on server in public_html but I want to edit and customize it on localhost , but the front page not showing

SwapnilAkolkar commented 5 years ago

what I tried is Options FollowSymLinks AddDefaultCharset utf-8

RewriteEngine On # the main rewrite rule for the frontend application RewriteCond %{REQUEST_URI} !^/(backend/web|admin) RewriteCond %{REQUEST_URI} !^/(api/web|api) RewriteRule !^advanced-project/frontend/web /advanced-project/frontend/web%{REQUEST_URI} [L] # redirect to the page without a trailing slash (uncomment if necessary) #RewriteCond %{REQUEST_URI} ^/admin/$ #RewriteRule ^(admin)/ /$1 [L,R=301] # the main rewrite rule for the backend application RewriteCond %{REQUEST_URI} ^/admin RewriteRule ^admin(.*) /advanced-project/backend/web/$1 [L] # redirect to the page without a trailing slash (uncomment if necessary) #RewriteCond %{REQUEST_URI} ^/api/$ #RewriteRule ^(api)/ /$1 [L,R=301] # the main rewrite rule for the api application RewriteCond %{REQUEST_URI} ^/api RewriteRule ^api(.*) /api/web/$1 [L] # if a directory or a file of the frontend application exists, use the request directly RewriteCond %{REQUEST_URI} ^/advanced-project/frontend/web RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d # otherwise forward the request to index.php RewriteRule . /advanced-project/frontend/web/index.php [L] # if a directory or a file of the backend application exists, use the request directly RewriteCond %{REQUEST_URI} ^/advanced-project/backend/web RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d # otherwise forward the request to index.php RewriteRule . /advanced-project/backend/web/index.php [L] # if a directory or a file of the api application exists, use the request directly RewriteCond %{REQUEST_URI} ^/api/web RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d # otherwise forward the request to index.php RewriteRule . /api/web/index.php [L] RewriteCond %{REQUEST_URI} \.(htaccess|htpasswd|svn|git) RewriteRule \.(htaccess|htpasswd|svn|git) - [F]

But not works..

SwapnilAkolkar commented 5 years ago

sorry I am not gettig how to configure it for localhost . if project is under /advanced-project/ in htdocs

SwapnilAkolkar commented 5 years ago

HI got some success with this htaccess but only problem is js and css are not loading correctly..

Dominus77 commented 5 years ago

Most likely the server settings. Apache should look at the root of the project in the directory c:/xampp/htdocs/advanced-project

Also check if there is .htaccess in the directory c:/xampp/htdocs/advanced-project/frontend/web and c:/xampp/htdocs/advanced-project/backend/web

Dominus77 commented 5 years ago

RewriteEngine On

RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d

RewriteRule . index.php

Dominus77 commented 5 years ago

Check Apache mod_rewrite

SwapnilAkolkar commented 5 years ago

thanks by default the xampp root is c:\xampp\htdocs and my current output is image for front end and it shows links to about as localhost/about instead of localhost/advanced-project/about

SwapnilAkolkar commented 5 years ago

does I need to change here return [ 'id' => 'app-frontend', 'language' => 'en', 'homeUrl' => '/', 'basePath' => dirname(DIR), 'bootstrap' => [ 'log', 'modules\main\Bootstrap', 'modules\users\Bootstrap', 'modules\rbac\Bootstrap', ],

Dominus77 commented 5 years ago

no

Dominus77 commented 5 years ago

You need to configure the server to the root directory of the project.

SwapnilAkolkar commented 5 years ago

ok thanks for suggestions..

Dominus77 commented 5 years ago

Try to log in: http://localhost/advanced-project/frontend/web