Why get incorrect file path when use mod rewrite in locahost ?
test.php
<html>
<head>
<base href="localhost">
</head>
<body>
<img src="test.jpg"/>
</body>
</html>
.htaccess
RewriteRule ^test/([^-]*)$ /test.php?id=$1 [L]
when call page localhost/test/111
file path of test.jpg
still localhost/test/test.jpg
but when call page localhost/test.php?id=111
it's work good show file path localhost/test.jpg
How can call page localhost/test/111
and show file path localhost/test.jpg
?
http://localhost/test/test.jpg
where localhost
is the domain name (not a folder). Indeed, base should be
<base href="/">