See what i want:
http://mysite.com/msn/a/
funny-display-pics.html
to:
http://mysite.com/msn/display-pics.php?cat=funny&id=
a
I try that code, and place my .htaccess file in
msn directory (not at root directory):
- Code: Select all
RewriteEngine on
RewriteRule ^([a-z0-9]+)/([a-z0-9_]+)-display-pics\.html$ display-pic.php?id=$1&cat=$2 [NC,L]
But it is not working (404 error).
I change it a little, and place in my www folder (root directory).
- Code: Select all
RewriteEngine on
RewriteRule ^msn/(.*)/([a-z0-9_]+)-display-pics\.html$ /msn/display-pic.php?id=$1&cat=$2 [NC,L]
i change ([a-z0-9]+) to (.*), now it is working, but images and links in that page, are not valid. Such as orignal image path is:
http://mysite.com/msn/images/image.jpg but when i check image path in that page, it is:
http://mysite.com/msn/a/images/image.jpgSo what to do? Also what is purpose of [NC,L]? I remove it, and there is no effect.
2) i write this code for changing every php file to html file:
- Code: Select all
RewriteRule ^msn/(.*)\.html$ msn/$1.php
It is working properly. Is it efficient way to change every php file to html?