A link that not exists

Ask about general coding issues or problems here.

Moderators: egami, macek, gesf

Post Reply

Tue Feb 26, 2013 3:17 pm

I'm new in PHP. I'm studying a web that a costumer has ordered.
There is a thing that I can't understand. There is an image with a link to an url that doesn't exists:

Code: Select all

<a href="../dir1/flats" target="_blank"><img src="../img/flats.jpg" alt="flats to rent" />
In the folder dir1 does exists no web.

If I run this web in the server I can't understand how, but a web appears with this address. But when I run it in my localhost, the navegator says that the url doesn't exists.

I've read in Google some sites where speaks about how to create an hiperlink in php, but I can't understand. Can anybody tell me how it works or a link where to learn it?

Thanks very much

New php-forum User
New php-forum User
Posts: 50
Joined: Fri Jan 20, 2012 8:00 am

Thu Mar 07, 2013 6:14 am

im a little unclear on what you are asking here but if i have it right then the folder that the anchor tag is targeting doesn't actually exist but on the website you get a page to load at that address.

my best guess would be that the live version of the wibsite is using a .htaccess rewriteRule to direct the request elsewhere.
if this is the case then on the webserver (most likley the root) will have a file called .htaccess
int the file you will find a line something like RewriteRule ^dir1/flats$ file.php?location=$1 [L, QSA]

i could be going in the wrong direction here but if this is the case read up on apache's rewrite engine

Post Reply