URL issues using Yii with XAMPP

Hi all,

I think I’m missing something here, I’ve taken a live copy of my site and put it into xampp for testing purposes. As far as I can see I’ve set it up correctly, the home page works fine, but when I click any links instead of going to the url I click on, or even a 404 page, it either leaves me on the homepage or takes me to ‘http://localhost/xampp/’.

For example, if I click through to the url ‘http://localhost/mysite.co.uk/site/contact/’ this takes me to the home page of the site, not the actionContact of the siteConroller.

If I turn urlmanager off in the config file and then navigate to ‘http://localhost/mysite.co.uk/index.php?r=site/contact’, this takes me to ‘http://localhost/xampp/’ instead? Which is even more weird!

Anyone have any ideas as to why this might be?

Thanks!

Stu

uuuuuh,

well, you can’t simply copy your site anywhere you like because your scripts need to know where your Yii framework components are. if you really want to put your site to another directory, you need move the yii framwork folder accordingly

for example, when you wish to use site/contact routes, you are actually calling the CController component, and it resides in the yii framework directory.

Yes, I’ve copied the entire site, including the framework directory into the correct place. It wouldn’t display the template and content for the home page if it wasn’t reading the site as a whole.

It just seems a little odd that if I go to somewhere that doesn’t exist, for example if I navigate to:

http://localhost/ this-site-does-not-exist.co.uk/

It will display:


Object not found!


The requested URL was not found on this server. If you entered the URL manually please check your spelling and try again.


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

Error 404

localhost

09/22/11 09:38:36

Apache/2.2.21 (Win32) mod_ssl/2.2.21 OpenSSL/1.0.0e PHP/5.3.8 mod_perl/2.0.4 Perl/v5.10.1 

However, if I navigate to a page that definitely does exist, it takes me to ‘http://localhost/xampp/’, which isn’t even in the same directory. Rather than displaying the 404 above?

Some htaccess file that should be modified?

/Tommy

yeah I was thinking that, but all the url trickery is done through the urlmanager in the site’s config file, but I don’t think it’s even reading that to be honest.