My application with UrlManager enabled works fine in local wamp server. When I hosted it on Godaddy I was getting internal server error. So I removed htaccess and UrlManager code. It worked fine but without beautiful urls.
I’ve restored htaccess and UrlManager code. I’m getting internal server error again.
This error is caused by some command in the .htaccess, try to leave only this in the .htaccess
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
If you get still the server error code, than mod_rewrite is not enabled!
I also get my Linux hosting from Godaddy and can confirm that rewrites are enabled. My .htaccess looks like this:
Options +FollowSymLinks
IndexIgnore */*
RewriteEngine on
# Make backend accessible via url: http://site/backend.
RewriteRule ^sysadmin& backend.php
# 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 [L]
The last line is critical because a single period is not enough. You have to have all the other characters for it to work. Check it out and good luck.
I’ve been away from Yii work for a while but recently returned. I can confirm that something changed between my earlier post (Yii 1.1.2?) and the new version 1.1.7. I’ll investigate and ask around; if I find an answer I’ll post it here. Thanks.
Got the solution to the ‘UrlManager + Godaddy’ saga.
This is how the .htaccess file should look. I tried to strip it down to the most required stuff.
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? [L]
See the question mark after ‘index.php’ in the last line? That is it. Just add the ‘?’ after index.php and it shall solve all your problems. No ‘Internal Server Error’ or ‘No Input File Specified’ errors anymore.
I was also facing same issue but i did this and it worked successfully
So posting it for some new user like me.
.htaccess – you need to place this file where index.php is there
Options +FollowSymLinks
IndexIgnore */*
RewriteEngine on
# Make backend accessible via url:
RewriteRule ^sysadmin& backend.php
# 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 [L]
You need to uncomment url path format and add two more things
Set main.php in your yii configuration, at component :
'urlManager'=>array(
'urlFormat'=>'path',
[b] 'showScriptName'=>false,
'caseSensitive'=>false, [/b]
'rules'=>array(
'<controller:\w+>/<id:\d+>'=>'<controller>/view',
'<controller:\w+>/<action:\w+>/<id:\d+>'=>'<controller>/<action>',
'<controller:\w+>/<action:\w+>'=>'<controller>/<action>',
),
),
also you need
This is killing me. I followed the last post and I still keep getting "No input file specified."
I am hosted with godaddy and here is my .htaccess
Options +FollowSymLinks
IndexIgnore */*
RewriteEngine on
# Make backend accessible via url:
RewriteRule ^sysadmin& backend.php
# 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? [L]
Anybody have any ideas, or maybe an suggestions on something obvious I could have missed. It works fine on my local. I didn’t use the yii tools to recreate the site, I just uploaded all the files from my local.
I also used Goddady and nothing of what is explained here worked for me, better said, only worked for controllers like “PostController”, but having something like “PostCommentController” didn’t work, that’s due to capital letters, so I had to change all my controllers on this way “PostcommentController” (name file and class name).
Had the same issue at GoDaddy. Works fine for me with such .htaccess file:
Options -Indexes
RewriteEngine on
RewriteBase /
# 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 [NC,L]
CUrlManager configuration basically looks as always: