Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8319681
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T22:24:08+00:00 2026-06-08T22:24:08+00:00

I’ve uploaded my Yii application to an Ubuntu 12.04 server running PHP5 and Apache2.x.

  • 0

I’ve uploaded my Yii application to an Ubuntu 12.04 server running PHP5 and Apache2.x. The .htaccess file contains:

RewriteEngine on
RewriteBase /

The UserController.php in /protected/controllers contains:

 public function actionLogin()
{
    $model= new Users();

    // if it is ajax validation request
    if(isset($_POST['ajax']))
    {
        echo CActiveForm::validate($model);
        Yii::app()->end();
    }
//                print_r($_POST['Users']);
    // collect user input data
    if(isset($_POST['Users']))
    {
        $model->attributes=$_POST['Users'];


        // validate user input and redirect to the previous page if valid
        if($model->login())
            $this->redirect(Yii::app()->user->returnUrl);
    }
    // display the login form
    $this->render('login',array('model'=>$model));
}

When I login to the site, I receive an HTTP404 message. The apache2 error.log states

file does not exist /var/www/users

How can I rectify this 404 error?

UPDATE:
It doesn’t appear that returnURL is valued. How do I setup returnUrl so that the user is redirected back to the previous page?

UPDATE2:
Here is a snippet from config/main.php:

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

Here’s the contents of the main .htacess file:

RewriteEngine On
RewriteBase /

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^admin/(.*)\?*$ admin.php/$1 [L,QSA]

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)\?*$ index.php/$1 [L,QSA]

php_value upload_max_filesize 20M
php_value post_max_size 21M  

UPDATE:
It looks like the root cause might be relative to the UserIdentity class being used to authenticate. Here’s a snippet of the users model:

public function login()
{

        if($this->_identity===null)
        {
                $this->_identity=new UserIdentity($this->username,md5($this->password));
                $this->_identity->authenticate();
        }
        if($this->_identity->errorCode===UserIdentity::ERROR_NONE)
        {
                $duration=$this->rememberMe ? 3600*24*30 : 60*20; // 30 days
                Yii::app()->user->login($this->_identity,$duration);
                return true;
        }
        else{
                $this->addError('password','Incorrect username or password.');
                return false;
        }
}

Would it be advisable to use CdbHttpSession insead of UserIdentity to accomplish login?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-08T22:24:09+00:00Added an answer on June 8, 2026 at 10:24 pm

    I think there is a problem with your .htaccess and Yii main configuration.

    http://www.yiiframework.com/doc/guide/1.1/en/topics.url

    I think if you have setup your config/main.php properly (can you put update the question with that ,specifically the urlManager part), You .htaccess needs to be

    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
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

We are using XSLT to translate a RIXML file to XML. Our RIXML contains
I have a .ini file as follows: [playlist] numberofentries=2 File1=http://87.230.82.17:80 Title1=(#1 - 365/1400) Example
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I have just tried to save a simple *.rtf file with some websites and
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I have a French site that I want to parse, but am running into
I want use html5's new tag to play a wav file (currently only supported
In my XML file chapters tag has more chapter tag.i need to display chapters
I am trying to render a haml file in a javascript response like so:
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.