1

I'm in process of cleaning my URLs.

Say I have a URL http://www.example.com/index.php?id=12345&name=some-name

I just changed it to look better using mod_rewrite

http://www.example.com/blog/12345/some-name

Now the pain is the page index.php is not loading any images, css files and the anchor links are all broken.

Location of my image is http://www.example.com/images/12345/some-image.jpg

I have used relative paths through out my site.

Now do I need to change links on all my pages ? Can .htaccess do some trick for me ? Please help.

Here is my .htaccess-

RewriteEngine On

RewriteCond %{SCRIPT_FILENAME} !-d

RewriteCond %{SCRIPT_FILENAME} !-f

RewriteRule ^blog/(.*)/$ index.php?id=$1 [NC,L]

RewriteRule ^blog/(.*)/(.*)$ index.php?id=$1&name=$2 [NC,L]
4

0 回答 0