i know basicly how to use php rewrite engine, but...
this is my rewrite rule
the url is; http://www.mypage.com/galeri.php?id=3
RewriteEngine On
RewriteRule ^galeri/([^/]*)$ /galeri.php?id=$1 [L]
and the result is; http://www.mypage.com.tr/galeri/3
it works fine, but i have to change all url parameters inside the pages like; from
<script type='text/javascript' src='js/jquery.min.js?ver=1.4.2'></script>//from this to...
<script type='text/javascript' src='http://mypage.com/js/jquery.min.js?ver=1.4.2'></script>
i'm sure there is an easy way to do this but how?
Guys thank you for your answers but i guess i have to make the question clear;
let's say there is an image tag inside tha page like;
src="uploads/image.png"
the page will seach the file inside galeri/3/uploads/image.png because of the rewrite url.Is there a way to ignore the rewrite url and look for the files on root directory?
Change the rule to this:
RewriteRule ^galeri/([0-9]+)$ /galeri.php?id=$1 [L]
This will only allow numeric IDs. Things like scripts will not be affected because they have letters.
With a RewriteCond
From:
RewriteEngine On
RewriteRule ^galeri/([^/]*)$ /galeri.php?id=$1 [L]
To
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^galeri/([^/]*)$ /galeri.php?id=$1 [L]
Kolink is also right, if you expect only numbers then rewrite only numbers.
I recommend including it as a PHP file with get_file_contents and using
<?php
$file = file_get_contents("JSFILE.js");
?>
Then parse it with PHP http://forums.digitalpoint.com/showthread.php?t=1136535