Yii Framework Forum: Missing details in Guide 2.0 - Yii Framework Forum

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Missing details in Guide 2.0 Rate Topic: -----

#1 User is offline   rackycz 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 58
  • Joined: 16-December 09

Posted 13 November 2017 - 11:31 AM

Hi.
I am creating this thread, because I want to inform about one missing thing in Guide 2.0:

Here is described how to enable nice URLs (without index.php and parameter r):
http://www.yiiframew...ing-pretty-urls

I think that there is shown everything, only content of file /yiibasic/web/.htaccess is missing. Would it be possible to add following example to the link above? Without it nice URLs do not work.

Options +FollowSymLinks
IndexIgnore */*
RewriteEngine on

# if a directory or a file exists, use it directly
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d

# otherwise forward it to index.php
RewriteRule . index.php


... I am using Windows7 + XAMPP

Yes, there is linked following page under the Guide (yellow box with Note), but it may not be obvious how to use it to all:
http://www.yiiframew...e-configuration
0

#2 User is offline   softark 

  • Keep It Simple
  • Yii
  • Group: Moderators
  • Posts: 3,418
  • Joined: 16-February 11
  • Location:Japan

Posted 16 November 2017 - 07:02 AM

View Postrackycz, on 13 November 2017 - 11:31 AM, said:

only content of file /yiibasic/web/.htaccess is missing.

.htaccess on the web root is not always necessary.

Quote

Options +FollowSymLinks
IndexIgnore */*
RewriteEngine on

# if a directory or a file exists, use it directly
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d

# otherwise forward it to index.php
RewriteRule . index.php

... I am using Windows7 + XAMPP

You could put this configuration in your httpd.conf instead of .htaccess since you have full access to your web server.

Sometimes, though, you will have to configure the web server using .htaccess, especially when you want to use a shared hosting service.
Guide > Special Topics > Shared Hosting Environment > Add extras for webserver
(http://www.yiiframew...s-for-webserver)

And, this is important, .htaccess has no meaning for nginx web server. The configuration of it will be totally different.

All in all, this is a subject regarding "How to configure your web server to run a Yii application", rather than "How to enable pretty url in Yii".
0

#3 User is offline   LoisABrewer 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 1
  • Joined: 18-November 17

Posted 19 November 2017 - 12:12 PM

View Postsoftark, on 16 November 2017 - 07:02 AM, said:

And, this is important, .htaccess has no meaning for nginx web server. The configuration of it will be totally different.


Can you please share the instructions to configure nginx web server? Or point me to some guide available on the 'net?
I used male extra and here are the results http://thejemreport....le-extra-review
0

#4 User is offline   softark 

  • Keep It Simple
  • Yii
  • Group: Moderators
  • Posts: 3,418
  • Joined: 16-February 11
  • Location:Japan

Posted 19 November 2017 - 06:10 PM

View PostLoisABrewer, on 19 November 2017 - 12:12 PM, said:

Can you please share the instructions to configure nginx web server? Or point me to some guide available on the 'net?

The Definitive Guide to Yii 2.0 should be the first place to be visited.

Guide > Getting Started > Installing Yii > Configuring Web Servers > Recommended Nginx Configuration
0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users