Uploaded website on server but HTML link pages showing error - php

I have designed a website and uploaded it successfully on a server. The HTML pages links is no more working.
The website is www.rentacar-mauritius.com the "Home" works well but the other ones do not like "Tours, Rent a Car" and so on. By viewing my source on the browser, you'll see my code.

Live server is case sensitive (Linux Hosting)
I change your URL to http://www.rentacar-mauritius.com/Rentacar.html and its working
Check your file name(s), Spellings
so your URL(s)
http://www.rentacar-mauritius.com/rentacar.html
http://www.rentacar-mauritius.com/tours.html
http://www.rentacar-mauritius.com/gallery.html
http://www.rentacar-mauritius.com/about.html
http://www.rentacar-mauritius.com/contact.html
should be
http://www.rentacar-mauritius.com/Rentacar.html
http://www.rentacar-mauritius.com/Tours.html
http://www.rentacar-mauritius.com/Gallery.html
http://www.rentacar-mauritius.com/About.html
http://www.rentacar-mauritius.com/Contact.html
Like wise check your whole site
Rent A Car

Filenames are case-sensitive for Linux environment. If your hosting server is running Linux, make sure that your file names match the href values exactly (including the case).

Related

how to upload CodeIgniter website on server?

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.

How to change local host for testing site in different environment

I'm sure this has been asked and answered before, however, I am new to the lingo ad couldn't find the answer.
I have made a php site with several pages. To access the site and links on my mac, all links and photos and such must point to http://localhost:8888/ To test on my linux machine, all links and photos must point to a different local host address. And when I load the site to my web server, of course the links and photos must point to the web address.
There aren't that many places in the 5 page site that need to be changed, but I am sure there must be a better way than hand editing.
How does one change the host location globally?
Thanks
I am not sure if this is what you are asking for but you probably should use relative path for your links and images.
For example if you have all your images in an "images" directory in the root of your site, you should do this
<img src="images/myimage.png">
instead of
<img src="http://siteaddress/path/to/image/image.png">
This way you don't have to change anything if you change the webserver.
Ideally you would want to have a configuration file that is specific for each environment storing the values in constants. So in your code you include the configuration file (as long as you need it) and you use the constants.
In the constants you can store values such as the connection to the database or the values of the root path/url that are specific to each environment so for example on your local machine you can have:
define('CONFIG_ROOT_URL', 'http://localhost:8888/');
whilst on the live website you might have:
define('CONFIG_ROOT_URL', 'http://your.domain.com/');
but in your code you just use:
$str_upload_page = CONFIG_ROOT_URL . 'upload.php';
echo $str_upload_page
//this should output 'http://your.domain.com/upload.php' on the live version
//and 'http://localhost/8888/upload.php' on your local machine

How do I get PHPStorm to use the correct path for CSS?

I have been using "Delphi PHP XE2". The file structure has worked fine for over a year on the development machine and the production.
The folders are organised as follows.
src/app_login.php
src/add
src/css
src/js
src/fnc
src/db
src/images
etc.
I am just trying out PHPSTORM. The include files work fine. When I run it in Firefox it can find all images, JavaScript files, etc. But it can not find the CSS files as it is looking for them in
css
rather than
src/css
I haven't changed anything.
Why is the browser now looking at absolute path rather than relative?
How did PHPStorm manage to tell it that?
And how do I coerce it to treat them as relative paths?
I see that in the browser it runs it as:
http://localhost:63342/SRC/app_login.php
instead of
http://localhost:63342/app_login.php
I guess this the problem. How do I coerce it to move down one directory level?
I am trying to set up IIS, I think this might be best for later on. Here are the screen shots:
I configured the hosts file so that when I type wys.com in the browser it tries to run it and shows a blank page. If I type in 192.168.1.0 it just shows a blank page. View Source shows nothing. I was expecting it to run the index.html at d:\wys\src. Why is the browser not running it?
You are using PhpStorm's own simple built-in web server which uses URLs like http://localhost:63342/ProjectName/app_login.php. You cannot make http://localhost:63342/app_login.php using such server as it will not be able to tell what files to serve.
Either use your own Apache/IIS/whatever web server .. or the best you can get with built-in server would be http://ProjectName:63342/app_login.php(IDE needs to know what site/files to serve somehow). For that:
Edit your hosts file (or local DNS server, if preferred and have one) and point ProjectName to your computer's IP (e.g. 127.0.0.1).
Create Deployment entry of correct type (In Place should do), configure it (provide desired URL etc -- http://ProjectName:63342/) and mark it as Default for this project -- now IDE will use URL from there when generating "open in browser" URLs.

Redirect htaccess localhost to IP

I'm currently working on a wordpress website using WAMP locally, I've got the site working fine on another local computer, however images aren't showing they're simply appearing as localhost/wp-content/etcetc instead of 10.0.1.2/wp-content/etcetc
CSS and everything else loads fine. Obviously the images load fine on the host computer, however I'm looking to setup so can work from LAN based machines too.
I figure htaccess would be a simple(ish) fix, if I at all knew what I was doing.
Basically could anyone point me in the direction of a htaccess code to directed localhost to 10.0.1.2 please?
Thanks!
The question you are asking is not the correct one - you do not want to change localhost to point to a specific private IP address or you will have issues with an unknown number of other things.
To properly correct the issue you will need to go through the process of Moving WordPress - updating the URLs in the options, postmeta, and posts tables. This can also be achieved by exporting the contents of your site to an XML file, doing a search and replace on this text document (change localhost to 10.0.1.2 or whatever host name you want), and then re-uploading it. You will need to update the site_url and wp_home values as well.
Follow the steps:
Go to Dashboard > Settings > General
In the 'WordPress Address (URL)' and 'Site Address (URL)' labeled text boxes replace the word 'localhost' with your IP address.
Save changes.
This solves your problem.

Dreamweaver creating temp php files instead of working direct from the local test server files

Trying to get MAMP running with Dreamweaver.
When I preview a php file inside Dreamweavers 'Live View' mode instead of working direct from my file:
http://localhost/php_test/timetest.php
it creates its own temp file which looks like:
http:// 127.0.0.1/php_test/ TMPWY5ZEM.php
(I've added the additional spaces as stockoverflow assumed I was spamming)
I know the localhost runs correctly as if I type the URL directly into a browser it runs fine.
I've set up the Dreamweaver site correctly to the best of my knowledge, the details are below:
Local site folder:
/Applications/MAMP/htdocs/php_test
Server Folder:
/Applications/MAMP/htdocs/php_test
Web URL:
http://localhost/php_test/
Testing Server:
PHP MySQL
Any help?
This typically means that you have the preview using temporary file preference set (which I believe may be a default setting). Do the following:
Edit (Dreamweaver on Mac) Preferences, Preview in Browser category, uncheck Preview using temporary file
setup a testing server, if you have some problems from there, set your site type to localhost.

Categories