PHPFixing
  • Privacy Policy
  • TOS
  • Ask Question
  • Contact Us
  • Home
  • PHP
  • Programming
  • SQL Injection
  • Web3.0

Wednesday, February 16, 2022

[FIXED] how to handle 'unable to resolve request' in yii 1.x?

 February 16, 2022     yii     No comments   

Issue

my url is like

e.g http://me.mydomain.com/admin/view/1

that url is reached by clicking a list item from

e.g 
http://me.mydomain.com/admin/list

hence the number 1 in the first url stands for an ID.

but when I manually put something like this in the url

e.g
http://me.mydomain.com/admin/view/asdfasdf1234

and pressed the enter key of the keyboard, I am getting an error that says

Unable to resolve the request "http://me.mydomain.com/admin/view/asdfasdf1234".

how to handle this error ?


Solution

In my case, I took files from GIT repository in to my windows , localhost dev environment and it gave me error URL not found Error404 , something like that.

Step1- Change config/main.php as follows

'urlManager' => array( 
    'urlFormat' => 'path',
    'showScriptName' => false,
    'rules' => array(              
                        '/' => '/view',
                        '//' => '/',
                        '/' => '/',

            ),

        )

Step-2 Now modify ur application .htaccess file , which shoul be outside just protected folder some rewite-rules as follows.... 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

Step 3- Restart your apache.and check in browser

Step4- Change http.config with Allow Override All , inplace of None.(For security point of view recheck this step).

This may or may not help you



Answered By - vpdeva
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg
Newer Post Older Post Home

0 Comments:

Post a Comment

Note: Only a member of this blog may post a comment.

Total Pageviews

Featured Post

Why Learn PHP Programming

Why Learn PHP Programming A widely-used open source scripting language PHP is one of the most popular programming languages in the world. It...

Subscribe To

Posts
Atom
Posts
Comments
Atom
Comments

Copyright © PHPFixing