Okey guys i have my project deployed to a subdomain folder on my server and when I try to access that subdomain -> new.mysite.com code igniter loads the 404 not found page.
It works perfectly on localhost and on a server without subdomain for example mysite.com.
Any ideas? I tried to change the base_url to new.mysite.com and it doesnt work.
Is there a way to see what url it is realy trying to load I don't know. I'm desperate i guess i have to touch the routes but what to write there?
This probably hasn't got to do with your base_url setting. If your index page doesn't get loaded, something else is probably wrong.
Are you getting CodeIgniter's 404 message, or Apache's?
In case you're getting CodeIgniter's 404 message (even for your default index page), chances are CodeIgniter isn't able to parse the relevant URL section correctly. In that case: please check (or provide us with) your .htaccess file (in case you're using mod_rewrite).
On a personal note: I've experienced such problem before too. After much fiddling and cursing, I eventually decided to just dive into CodeIgniter's system files (I believe it was system/core/CodeIgniter.php) and to alter the piece of code that reads the relevant piece of the url.
Related
I've got a legacy PHP project to fix a thing or two. I've downloaded it via FileZilla and served it on my local machine with a local copy of the database. The project is exactly the same with the live one, yet the live one can open the url/contact.html but on my machine it says no such file is found. All other pages go for url/categories/ or url/products/ so I've tried altering the url but no use.
All the other pages within the site are simple: one .php controller one .php model and one .tpl smarty template view. Requiring no .html at all. But this one is somehow different. The .htaccess file is exactly the same as the live version. I've tried adding a rewrite rule to direct every .html to .php but didn't work. I'm lost and out of options, please help? It doesn't even have to be an answer,"Try looking into that" would work too.
I'm working via XAMPP on windows, and I've configured the https:// to http:// on my project but that's all. Even hidden files are checked and confirmed.
have checked that contact.html is a static file (like a real existing html file?)
is there some kind of "routing" within the PHP of the project? If there is route urls might be really anyware.. in the mysql database, redis, a json file and whatnot.. have seen them all.
try to debug where and how it works on the "production" server by using some logging to a file edit the file through filezilla and log to a 'mylog.log' file until you find out what is going on.. or if the site is not used all the time by clients - you can just try to echo stuff to figure out how this exact /contact.html works
I am new to stackoverflow.
I have already installed a WordPress blog(WordPress version 3.9.2) within a CakePHP(CakePHP 1.3) site.
I have followed this link:
http://www.balistupa.com/blog/2010/08/how-to-redirect-appwebrootblog-into-blog-wordpress-cakephp/
Changed both the .htaccess files as mentioned in the link.
Its working perfectly.
But the problem is if I write the url like: www.mydomain.com/blog/ then its working perfectly
But if I write www.mydomain.com/blog, that means without a / at the end, it is still redirecting to www.mydomain.com/app/webroot/blog/.
Can anyone solve this out? Do I need to make any more changes to that .htaccess files?
The tutorial on that link says that if I wont write that / at the end it will be redirected to the proper url without any problem, but still its not working.
My PIP PHP framework was doing fine, then I messed something up: I don't know what it is. Basically for every controller except my default, I get a 404 not found error. If I change the default to a different page, the new page will work fine, but no others will. I can't seem to find any information in the logs.
I'm wondering if there is a good way to trace the route apache is using to find the new page. Or if there are any logs I can check. My local log.txt within the framework shows nothing. Apache log shows nothing. PHP log shows nothing.
I thought it may have something to do with the base_url, but no matter how I change it, my controllers are still not found.
$config['base_url'] = ''; // Base URL including trailing slash (e.g. http://localhost/)
Is there any way to see the absolute path that apache/ my browser is trying to take when I load localhost/controller? Something that would show me file://Applications/MAMP/htdocs/path/to/controller, even if the page doesn't load? Is there somewhere in the config/sys file that I can show that info?
Not sure why it was downgraded. I thought I gave all the information I had about the problem and just looking for how to troubleshoot a 404 not found when my default_controller loads.
Weird! I downloaded a new copy of PIP, copied all the files from my old copy to my new copy, and then now it works. It must have been some directory thing with Apache.
if you have apache running, set the base url to
$config['base_url'] = 'http://localhost/';
// remember the forward slash at the end.
if that still does not do it, go to your MVC framework folder, and replace the index.php and the system folder and all its content, you can take a back up if you want of this folder before you do so,
The there are two files that will mess with the routing
index.php
pip.php
so if your config base url is set as the example above and the controllers are still not found it is one of these two files that have been modified.
// note, you might also want to check the .htaccess file for mod_rewrite which needs to be enabled.
Alright, my application has been running fine for a few months now. Starting this morning all of my custom routes no longer work.
Have a controller named 'stuff' in a folder named 'mL'. Set up a custom route:
$route['default_controller'] = "mL/stuff";
Then visit 'website.com/', works fine, gets me to the 'controllers/mL/stuff' controller. Now, if I try to use a custom route:
$route['stuff'] = "mL/stuff";
and visit 'website.com/stuff' I get sent to my 404 page (as set in $route['404_override']).
This is true of all of my controllers, if I set it as the default_controller it works without issue. Someone else upgraded the server to php 5.4.9 over the weekend, and it's the only thing I can think of that might affect this, but I can't figure out how/why.
I dont think a php upgrade in itself would do this but something else must have had a tinkering.
Only thing I can think of is the htaccess or the apache config/setup has been changed - perhaps all or part of your htaccess is no longer working as a result (e.g. mod_rewite no longer enabled)
Either try restoring index.php in the config and the url to see if the page loads?
Can you check if mod-rewrite enabled. Check httpd.conf is set to allowOverride ALL for your directory and that the mod_rewrite line is not commented out.
check here for full details: http://www.tildemark.com/enable-htaccess-on-apache/
In future, if it aint broke, dont update it!
Same happened with me, couldn't figure something out but i rolled back to php 5.3.x and it will work again until we get proper update for this from codeigniter team but last update was like the below
I highly doubt that this is PHP-related. I'd guess that another
version of Apache (and mod_rewrite) is used with PHP 5.4 and I'd look
into httpd.conf and/or .htaccess
by narfbg
I'm trying to setup pagelime to work with a codeigniter site of mine and it looks like I have everything setup because I can view and edit the site in pagelime, but when I publish the page that i've edited, it says successfuly, but if I go to the webpage, it doesn't contain any of the changes that i just made.
I'm guessing it might have to do with the way that codeigniter url's work because when setting up the site, it asks for the url+index page. I tried setting my index page to http://example.com/index.php/controller/index but pagelime always adds index.php to your url so it looks like this - http://example.com/index.php/controller/index/index.php.
Has anyone setup a codeigniter site on pagelime successfully and can help me with this issue?
I have and the way that pagelime works it will not work with a CI framework since as you have found out, pagelime is setup for standard websites. ie: all pages are in the root and subpages follow the link structure so a link to homepage.com/pictures/album1 should be in the root of the ftp then in the pictures folder and to the album1 whereas we know that the pictures "folder" is nothing more than a controller. I hope that I explained that right or that you can decode what i was trying to say there.
First, make sure to add extensions to your routes in the .htaccess file:
Codeigniter Routes for filename with extension
In Pagelime, you can set each page to have an FTP Publish Target in the page properties screen. Set the target to the URL of your view, and you should be good to go.
Hope that helps!