Dominus77 / yii2-advanced-start

Yii2 Start Project Advanced Template

Home Page:https://dominus77.github.io/yii2-advanced-start/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Translate the menu

SwapnilAkolkar opened this issue · comments

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

Hi, the language changes in the application configuration files:
frontend:

'language' => 'ru',

backend:
'language' => 'ru', // en, ru

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.

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?

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

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

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..

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

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

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

RewriteEngine On

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

RewriteRule . index.php

Check Apache mod_rewrite

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

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',
],

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

ok thanks for suggestions..