Codeigniter only $route['default_controller'] works - codeigniter-3

This project worked until I cloned it on a different location, The only route which works now is $route['default_controller'] when I try to access to another route I get an 404 error but I've changed nothing until the last time it worked.

You may hide the index.php from the url by rewritting urls in .htaccess, Please check you have .htaccess file in new location or right base path in .htaccess file.

Related

404 Not Found! when trying to server_ip/filename

I have uploaded a file to /var/www/html, which is the document root on my server, but when I go to a browser and type ip_to_server/filename I get a 404 not found erorr page?
folder "www" is the root folder by default. Have you changed it?
If you place your file directly in "www" (www/yourfile) and go to "ip_to_server/filename" it should work.
If you have a folder "html" in "www" and place your file under "html" then you'll need to go to "ip_to_server/html/filename" to access it

base url dont work on typo3 6.2

i have problem after installing the bootstrap package on my localhost wamp
http://localhost/fileadmin/bsdist/lib/bootstrap/3.2/css/bootstrap.min.css?1419681956
i have added config.baseURL
baseURL = http://localhost/typo3/
/typo3/ is the admin panel you can't set that URL as baseURL. I don't you what happen but i think he will remove that part.
So set your Domain as baseURL and don't forget the / at the end.
baseURL = http://localhost/
don't forget to clear your complete cache to load the changes.
As #Stony already pointed you cannot use .../typo3/ as baseURL because this is location specific for TYPO3's backend.
On the other hand working with TYPO3 in subfolders always rises some problems as you need to change several configs (i.e. in .htaccess for url rewriting) to make it working correctly. And as I last tested clean installation in subfolder doesn't work as expected out-of-the-box.
Fortunately there's simple and elegant solution - creating custom domain locally.
Just in your hosts file add line like
127.0.0.1 myproject.loc
Add a vhost for this myproject.loc in your Apache config
Restart Apache and flush the DNS cache
In such case your project will be available locally at url http://myproject.loc/ so you can use it as well as your baseURL
If the typo3 installation is not in the domain's root directory, you must modify the RewriteBase in the default htaccess:
RewriteBase /<project_directory>
In your case:
RewriteBase /typo3

Markdown CMS bypasses htaccess file

I'm using Pico CMS, a small markdown project - http://pico.dev7studios.com/- installed and running good, however I am trying to password protect a folder with htaccess file but the cms is bypassing this and showing the file I call in the browser.
The funny thing is that the url for the file does not contain the "content" folder which is where all the files/pages are stored. All the other folders are contained in the url. This is the only reason that I can find to explain what's happening.
If I manually enter the url to that same folder, which is password protected, which includes the "content" folder in it's path, then I get the htaccess auth window showing. This proves the htaccess file is being read, but not when the CMS accesses it. Can anyone explain why and how to force the folder to be protected when I call any page with the browser.
If you open up a Pico site, your request is redirected to the index.php file (via mod_rewrite). That's why the "content" folder does not show up in the url.
That's also the reason why you are not asked for a password. The index.php file does not have to pass the htaccess auth to get to the *.md files.
Read this for a bigger picture:
https://stackoverflow.com/a/10923542/3294973
This plugin may be interesting to you:
https://github.com/jbleuzen/Pico-Private
Unfortunately, it can't protect only part of the website at this point.
Protecting single pages is now possible. (Check my GitHub Fork)

Zend Routing not working correctly

I have a Zend app which I am trying to port over to a [new] computer. I have it working already on the previous machine.
When I go to the URL localhost/myapp, the application loads the correct index page (i.e. runs my IndexController.indexAction() as it should). However, when I go to any other page, I get an error that the controller "myapp" cannot be found.
I have confirmed that rewrites are working (the error page that is rendered is via my custom ErrorController) - it seems that for some reason, Zend is treating the webroot as localhost, which means that the first parameter after that, "myapp", is being treated as the controller.
Any ideas as to what might cause this, and how to fix it without moving the entire application into the root of the web directory?
Found the answer with the addition of the following line in my htaccess file:
RewriteBase /myapp
I'm not quite sure why this line is needed (it's completely omitted on the original computer where the application works just fine), but adding it in solved the issue.
This was working because your .htaccess file is at the root directory so by localhost/myapp it was going to its index.php but couldnt find .htaccess in the project's folder

Change document-root on Shared-host?

When you deploy a Zend Framework website to a shared host, you usually cannot change the DocumentRoot to point at the public/ folder of the website. As a result the URL to the website is now http://www.example.com/public/.
Apart from choosing a proper host..there's any workaround?
thanks
Luca
If you have access to directories above public, you can put all non public files there.
Otherwise, you can put everything in a subdirectory, and block access to it with an .htaccess file.