Jump to content
Larry Ullman's Book Forums

Recommended Posts

Hi everyone! I am trying to create a clean URL for yii_cms application. 

I install xampp (c:/xampp) and I delete # sign in httpd.conf (this line: LoadModule rewrite_module modules/mod_rewrite.so). Then, I create .htaccess in C:/xampp/htdocs/yii_cms folder.

.htaccess file contains these lines:
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)\?*$ index.php/$1 [L,QSA]
</IfModule>

Then..., I edit main.php at C:/xampp/htdocs/yii-cms/protected/config/main.php and add two lines in bold format:

 

'urlManager'=>array(

                        'urlFormat'=>'path',
                        'showScriptName'=>false,
                        'caseSensitive'=>false,
                        'rules'=>array(
                                '<controller:\w+>/<id:\d+>'=>'<controller>/view',
                                '<controller:\w+>/<action:\w+>/<id:\d+>'=>'<controller>/<action>',
                                '<controller:\w+>/<action:\w+>'=>'<controller>/<action>',
                        ),
                ),

 

I restarted apache service through xampp control and I get this error while accessing the page (http://localhost/yii...page?view=about) <= local server

 

Object not found!

The requested URL was not found on this server. The link on the referring page seems to be wrong or outdated. Please inform the author of that page about the error.

If you think this is a server error, please contact the webmaster.

Error 404

localhost
Apache/2.4.4 (Win32) OpenSSL/0.9.8y PHP/5.4.16

What is wrong with my page if I access with no index.php? If I access them using index.php, everything is OK.

Please, help me with these errors. 

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...