oshry70
Posts: 4
Joined: Wed May 15, 2019 1:50 pm

PI 3 apache web server "href " link to anither html page

Sun May 19, 2019 8:40 am

HI,
i installed apache on PI 3 the page is index.php and i have nav bar with some links to another html page in my website the problem is when i put the path to the html page i get the error "the requested url was not found http://localhost movies/index.html"
the movies folder is inside html folder i gave permission to the folder and all files .
in my laptop all work great . maybe the path is different in raspberry pi??
thanks for help

Ernst
Posts: 1140
Joined: Sat Feb 04, 2017 9:39 am
Location: Germany

Re: PI 3 apache web server "href " link to anither html page

Sun May 19, 2019 8:48 am

oshry70 wrote:
Sun May 19, 2019 8:40 am
"the requested url was not found http://localhost movies/index.html"
Do you notice the problem above ? You should look at the URL to find out why you are using local host.
And you should find out why there is a space in the URL (cut&paste error ?)
The road to insanity is paved with static ip addresses

ankith26
Posts: 101
Joined: Mon Mar 25, 2019 11:08 am
Location: Earth
Contact: Website

Re: PI 3 apache web server "href " link to anither html page

Sun May 19, 2019 1:58 pm

You have to be careful while writing the path. Remember "movies" and "Movies" are two different words.
Also make sure that the index.html file exists
My website is at https://pratt.ml
Hope it runs (which it wont)

oshry70
Posts: 4
Joined: Wed May 15, 2019 1:50 pm

Re: PI 3 apache web server "href " link to anither html page

Mon May 20, 2019 5:28 am

i didn't change nothing i copy the same files from my PC windows 10 and website work fine with all path
but when i copy to PI3 i get this error ... maybe the path for the HTML file in sub-directory is different from windows 10 ?

Ernst
Posts: 1140
Joined: Sat Feb 04, 2017 9:39 am
Location: Germany

Re: PI 3 apache web server "href " link to anither html page

Mon May 20, 2019 7:29 am

oshry70 wrote:
Mon May 20, 2019 5:28 am
i didn't change nothing i copy the same files from my PC windows 10 and website work fine with all path
but when i copy to PI3 i get this error ... maybe the path for the HTML file in sub-directory is different from windows 10 ?
Solving a problem like this remotely is like blind brain surgery with chopsticks, to be able to succeed lots of information is needed. Please answer all the questions below.

a) you have a website on your windows 10 PC that looks to be working correctly.

a few questions:
- do you have apache2 installed on the PC ?
- what browser did you use to test your website ?
- where did you use the browser ?
- what is the URL you used to open the website.

b) you have copied website on from your windows 10 PC to a raspberry pi.

a few questions:
- how did you copy the files ?
- do you have apache2 installed on the Pi ?
- what browser did you use to test your website ?
- where did you use the browser ?
- what is the URL you used to open the website.

and at last (for the moment), please post the code (href) giving you problems using [code] [/code] tags in your reply to this post.
The road to insanity is paved with static ip addresses

oshry70
Posts: 4
Joined: Wed May 15, 2019 1:50 pm

Re: PI 3 apache web server "href " link to anither html page

Mon May 20, 2019 7:51 am

a) you have a website on your windows 10 PC that looks to be working correctly. = yes

a few questions:
- do you have apache2 installed on the PC ? yes i use xampp server with apache for this website
- what browser did you use to test your website ? chrome or Edge
- where did you use the browser ?
- what is the URL you used to open the website. = localhost

b) you have copied website on from your windows 10 PC to a raspberry pi. = yes

a few questions:
- how did you copy the files ? copy paste as is
- do you have apache2 installed on the Pi ? yes
- what browser did you use to test your website ? i use the default browser and chrome
- where did you use the browser ?
- what is the URL you used to open the website. = localhost

this is the code in main page Index.html
movies is folder in

<li><a href="MOVIES/INDEX.HTML">MOVIES</a>

Ernst
Posts: 1140
Joined: Sat Feb 04, 2017 9:39 am
Location: Germany

Re: PI 3 apache web server "href " link to anither html page

Mon May 20, 2019 8:23 am

oshry70 wrote:
Mon May 20, 2019 7:51 am
<li><a href="MOVIES/INDEX.HTML">MOVIES</a>
Do you understand that Windows file systems are case-insensitive and Linux file systems are case-sensitive ?
What this means it that the filename "MOVIES" or "movies" are the same under Windows but different under Linux.
Please keep this in mind.

Do you understand that in a Windows file system there is a "hidden" attribute that does not exist under Linux ?
Under Linux a leading "." is used for hidden files, you can see this using the "ls -la" command.

Please keep the above in mind, it could be important.

I do not like the way you have specified the href= because it is too loose, doing some research I found the following:
An absolute URL contains all the information necessary to locate a resource. A relative URL locates a resource using an absolute URL as a starting point. ... A relative URL typically consists only of the path, and optionally, the resource, but no scheme or server.
in my documentation I found the following information:
With a relative URL, you provide an abbreviated document address that, when automatically combined with a "base address" by the system, becomes a complete address for the document.
In your case "http://localhost" is being combined with "MOVIES/INDEX.HTML" giving the absolute URL "http://localhost MOVIES/INDEX.html" (watch the space, I don't know why this happens)

The solution to this might be simple: if the directory MOVIES is in the base directory of the site then use the following:

Code: Select all

<a href="/MOVIES/INDEX.HTML">MOVIES</a>
if the directory MOVIES is in a directory below another directory under where the source page is located:

Code: Select all

<a href="./MOVIES/INDEX.HTML">MOVIES</a>
In any case you have to cleanup your site to use lowercase only because soon you will run into a problem and wonder why.
The road to insanity is paved with static ip addresses

oshry70
Posts: 4
Joined: Wed May 15, 2019 1:50 pm

Re: PI 3 apache web server "href " link to anither html page

Mon May 20, 2019 8:55 am

many thanks it's works :D
the problem that is all the files need to be with lower case

Ernst
Posts: 1140
Joined: Sat Feb 04, 2017 9:39 am
Location: Germany

Re: PI 3 apache web server "href " link to anither html page

Mon May 20, 2019 9:11 am

oshry70 wrote:
Mon May 20, 2019 8:55 am
many thanks it's works :D
the problem that is all the files need to be with lower case
No problem, lower case is the better choice.
The road to insanity is paved with static ip addresses

Andyroo
Posts: 3316
Joined: Sat Jun 16, 2018 12:49 am
Location: Lincs U.K.

Re: PI 3 apache web server "href " link to anither html page

Mon May 20, 2019 12:52 pm

oshry70 wrote:
Mon May 20, 2019 8:55 am
many thanks it's works :D
the problem that is all the files need to be with lower case
Do not do it by hand - a quick Google will show you lots of ways to do it from the command line - if you do not understand the command try it on a backup first :lol:
Need Pi spray - these things are breeding in my house...

Return to “Troubleshooting”