Yii Framework Forum: URL Management [.htaccess ready to copy and paste] - Yii Framework Forum

Jump to content

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

URL Management [.htaccess ready to copy and paste] Rate Topic: *---- 1 Votes

#1 User is offline   revo110 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 78
  • Joined: 04-March 09

Posted 10 July 2009 - 01:31 PM

Hi, just want to share info about URL Management written in the Documentation about hiding the index.php:
http://www.yiiframew...uide/topics.url

Use the .htaccess from Zend Framework instead, or copy and paste this .htaccess below:

Options +FollowSymLinks
IndexIgnore */*
RewriteEngine on

#Uncomment "RewriteBase /" when you upload this .htaccess to your web server, and comment it when on local web server
#NOTE:
#If your application is in a folder, for example "application". Then, changing the "application" folder name, will require you to reset the RewriteBase /[your app folder]
#RewriteBase /[your app folder - optional]

# if a directory or a file exists, use it directly
RewriteCond %{REQUEST_FILENAME} -s [OR]
RewriteCond %{REQUEST_FILENAME} -l [OR]
RewriteCond %{REQUEST_FILENAME} -d

# otherwise forward it to index.php
RewriteRule ^.*$ - [NC,L]
RewriteRule ^.*$ index.php [NC,L]


Good luck!

0

#2 User is offline   codezilla 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 20
  • Joined: 14-July 09
  • Location:Thailand

Posted 14 July 2009 - 11:03 AM

:) Thank you!
0

#3 User is offline   jonah 

  • Advanced Member
  • Yii
  • Group: Yii Dev Team
  • Posts: 733
  • Joined: 27-November 08
  • Location:California (US)

Posted 14 July 2009 - 06:13 PM

What is better about this?
1

Share this topic:


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

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