I could not get the URL manager to work at c2eay.com
I tried all options, read document and forum. No matter what I do it throws me to the index page. The site is up and help is appreciated. Thanks
I could not get the URL manager to work at c2eay.com
I tried all options, read document and forum. No matter what I do it throws me to the index page. The site is up and help is appreciated. Thanks
post up some code, maybe I can point you in the right direction.
My bad the site is C2eat.com
Here is my .htaccess
Options +FollowSymLinks
IndexIgnore /
RewriteEngine On
RewriteBase /
RewriteRule ^(application|modules|system) - [F,L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule .* index.php/$0 [PT,L]
The main.config
,'components'=>array(
'log'=>array(
'class'=>'CLogRouter'
,'routes'=>array(
array(
'class'=>'CFileLogRoute'
,'levels'=>'trace, info, error, warning'
),
),
)
// MySQL Connection
,'db'=>array(
'class'=>'CDbConnection'
,'connectionString'=>'mysql:host=localhost;dbname=c2eat'
,'username'=>'root'
,'password'=>''
)
,'rbac' => array(
'class'=>'application.components.Rbac'
)
,'request'=>array(
'enableCsrfValidation'=>true
,'enableCookieValidation'=>true
)
,'image'=>array(
'class'=>'application.extensions.image.CImageComponent'
,'driver'=>'ImageMagick' // GD or ImageMagick
// ImageMagick setup path (mostly for win)
//'params'=>array('directory'=>'/opt/local/bin'),
)
,'user'=>array(
// enable cookie-based authentication
'allowAutoLogin'=>true
,'loginUrl'=>array('/rbac/logins/login')
)
,'urlManager'=>array(
'urlFormat'=>'path'
,'rules'=>array(
'listings/<naic:\d+>'=>'listings_master/listlevel',
),
),
), //end of components
Have you tried setting your RewriteRule to
Aside from that I can spot no difference in our .htaccess to yours.
Yes, I have tried that as well
I need help here - please. Have read all the forum and the guides but to no success.
Have you checked wether your server reads .htaccess files at all? You can find out by putting some garbage into that file - it should throw an “Internal Server Error” on next page load.
Some words on what exactly doesn’t work would also help helping
When I put junk in my .htaccess I get this error:
Additionally, a 500 Internal Server Error error was encountered while trying to use an ErrorDocument to handle the request.
Do I have to use this in the View or Controller as well
$this->createUrl('listings_master/listlevel',array('naic'=>722));
What do you mean it does not work? Could you describe the URL you are trying to access and the corresponding error you encountered? Without these information, no one can help you.
Here is my .htaccess
## Can be commented out if causes errors, see notes above.
Options +FollowSymLinks
# mod_rewrite in use
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . index.php
My config.main.php
My Listings_masterController.php
Complete View code list_level.php
As you can see here: http://c2eat.com/ind…tlevel&naic=722
The URL rewrite send me to the index page. IS my createURL in the wrong place?
And with the showScriptName = false, it gives PAge Not Found error. The URL for this looks like: http://c2eat.com/lis…tlevel&naic=722
Sorry, never did rewrites before. Thanks to all!
In config file URL Manager should be in component array like this:-
'components'=>array(
---------------,
---------------,
'urlManager'=>array(
'urlFormat'=>'path',
'rules'=>array(
'post'=>'post/list',
'post/<id:\w+'=>'post/read',
),
'showScriptName'=>false,
'caseSensitive'=>false,
),
---------------,
---------------,
),
For rewriting the URL following things should be done in httpd file of Apache:-
1] mod_rewrite module should be uncommented.
2] In <Directory> section AllowOverride None should be replaced with AllowOverride All.
3] Application directory must contain a .htaccess file with following code:-
Options +FollowSymLinks
IndexIgnore */*
RewriteEngine on
RewriteBase /Your Application Directory Name/ //It is compulsory.
# 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
You can also take the help of following links:-
http://www.yiiframework.com/doc/guide/topics.url
Definitely all these will help you.
It’s working for me perfectly.