I have written a controller with name CMS (capital letter). When I call the link http://localhost/CI/testing/admin/cms/insert, It has no problem. Its working fine in localhost.
After uploading that page to server and when I execute the statement, http://dev.test.in/testing/admin/cms/insert, it doesn't display the page. But when I change the url to http://dev.test.in/testing/admin/CMS/insert, its in a working condition.
In order to solve this either I will have to change the controller name to cms(small letter) or change all the anchor url to CMS. Is there any other solution to solve this. Like writing htaccess file?
The problem exist coz file name differs on Linux and Windows
MyFile & myfile can not exist in a same path in Windows, but can on a Linux
Related
I am linking my navigation bar list items to includes folder page with href Attribute
<li>Brands</li>
I have tried copying full path
I have tried setting permission on htdocs to 777 but still not working.
My code and folder structure
I am using new Ubuntu machine (16.04) with XAmp
This is my error :
Object not found!
The requested URL was not found on this server. The link on the referring page seems to be wrong or outdated. Please inform the author of that page about the error.
You are putting wrong path
This is your site url
http://localhost/FoundationFlex/
and this is your file path
Brand
replace your code with this <li>Brands</li> or <li>Brands</li>
the problem in your href link is that you are giving a file path in browser, which correct but not executable nor a website url so it will always throw a 404 error which means the web page doesn't exits.
You are trying to link using PATH on server, use URL instead and make sure this file is accessible from browser
<li>Brands</li>
You are using the full file system path of the file. But you must enter a relative path to your webservers root folder (htdocs).
So if you call your page with http://localhost/ then in your case your webserver root folder seems to be /opt/lampp/htdocs/. Linking the file brands.php in a html link will look like this (relative):
Brands
or absolute
Brands
or (but this one should have the same result ase the one above:
Brands
These links can help you:
https://www.coffeecup.com/help/articles/absolute-vs-relative-pathslinks/
https://www.w3schools.com/html/html_links.asp
If /opt/lampp/htdocs/FoundationFlex is your servers DocumentRoot you can just
Brand
I just created a website in CodeIgniter. And it is working fine on localhost {for eg: localhost/project_name/controller_name} but after uploading it to the server{for eg: www.domain_name.com/project_name/controller_name} it is showing ERROR 404.
what I do is simply make a zip file of the project and then extract it on the server.Please guide me if I am doing it in wrong way.
Possible you using development on windows, where you specify the controller in lower characters, now on web server is linux which is case sensitive, you might need to rename your controller, and make its first letter capital
Make sure you have changed the base url according to your domain and database related configuration (database name, user name and password) also.
I cant access my images when I run on my live server but it work on local. I have doubled check and my url is right but the images still doesnt show up
mysite.com/public/vendor/Beautymail/assets/images/sunny/logo.png
%PUBLIC%/vendor/Beautymail/assets/images/sunny/logo.png
I only get a: Sorry, the page you are looking for could not be found.
*I am using Laravel Forge with DO
Maybe it because Windows isn't case sensitivity but Linux is.
Try to change all the directories and files names to lowercase letters and also in your url, so that your new url will be: (notice that all letters are lowercase):
mysite.com/vendor/beautymail/assets/images/sunny/logo.png
I'm using HostGators preview feature which allows you to preview your files on the server without having to point a url.
The formatting is like so
http://server.domain.com/~cpanelusername/
Now, I have my base_url set to the above in my config.php file, however I'm running into this issue. My resources are not going to the url as listed above, but instead is trying to load them like:
http://server.domain.com/resources/images/logo.png
As you can see it's doing it without the CPanel Username in the url.
$config['base_url'] = "http://server.domain.com/~q0j8t5p6/";
This is what my base_url looks like in the file.
Has anybody successfully made this work? If so, how?
I currently have wampserver running and I'm trying to do live preview of a php file using Brackets.io. However when I click live preview I'm getting
Project settings for: Getting Started
Live preview base URL: ______________
I'm following this tutorial on running PHP scripts.
My php file is in C:/wamp/wwww/php_proj1/php1.php so I've been trying to put this in my "Base URL"
http://localhost/php_proj1/php1.php
However everytime when I type that and enter it, it just asks me for the "Live Preview Base URL" again and nothing happens. I also tried putting the URL in my 'File->Project settings' and that also didn't work. I'm just running a basic php script that echos some words.
It works when I manually type
http://localhost/php_proj1/php1.php
in my Chrome URL but not when I use Bracets live preview.
What am I missing or doing wrong? Do I need to config anything in my wampserver? I've just started learning php and using wampserver so I'm not entirely sure what I'm doing wrong.
Thanks!
EDIT: I'm following these 2 tutorials on doing this and it's just not working for me.
tutorial 1 and tutorial 2
EDIT2: Found my mistake.. I did not do File->Open Folder to open the folder that I was working on... Thanks to everyone that helped me with this, I will definitely not make this mistake again. sigh
The Live Preview Base Url should be set to the same url that you would use to launch your project in a browser.
So if you have a project in C:/wamp/wwww/php_proj1/ you would launch that project in a browser by entering http://localhost/php_proj1/php1.php therefore that is what Brackets is expecting to be entered into the Base Url field minus the actual script file name.
Remember the DocumentRoot of localhost is pointing to the folder C:/wamp/www/
So enter
http://localhost/php_proj1/
into the dialog that requests the Base Url.
Assuming you are editing the file php1.php at the time you clicked the Live Preview icon that is the script that will be run in the browser.
Oh and of course you have to have WAMPServer and therefore Apache up and running when you do this as it is running the code through Apache so that the PHP code can be interpreted.
Found my mistake. I did not do File->Open Folder to open the folder that I was working on...
Try the same thing but with a simple HTML file.
Try launching your project with PHP's built-in server. Open a terminal/cmd window and go to the folder php_proj1. Now execute php -S localhost:8000. Now set your Live preview path to http://localhost:8000/. If this one does work, then there may be a problem with Wamp.
Now remember that no matter what, you're not supposed to contain a file in the Live Preview path, but only a folder path. When you contain it, you get to this URL: http://server/file.php/file.php (double) and that's not exactly what you want...
If none of these work - there may be a problem with either your computer, Brackets, Chrome, or both. Try to reinstall them (Brackets first).
My two cents, is the name of the project php_proj1 ? If not you'll have to use http://localhost/ as your base URL.
Also (When you are using Brackets) check the content of the Chrome Network tab. F12 Developer Tools -> Network -> Filter -> Documents
Try to investigate the URLs, probably that'll give you some insight