hi DP Programmers, I need your help fixing problem in the following codes. here is 2 lines of my site htaccess code: RewriteRule ^(.*)/blogs /sites/blog.php?url=$1 RewriteRule ^(.*)/blogs/(.*) /sites/blog.php?url=$1&id=$2 and while, accessing the following url in site, somesite.com/akildeoza/blogs - it works correctly. somesite.com/akildeoza/blogs/1 - not working properly  (akildeoza is not getting posted) may i know, whats wrong here. Thanks for all help in advance. warm regards anuradhan
Check to make sure your folder path matches what the rewrite rule is sending the blog.php RewriteRule ^(.*)/blogs /sites/blog.php?url=$1 - folder/blogs is sent as /sites/blog.php?url=folder RewriteRule ^(.*)/blogs/(.*) /sites/blog.php?url=$1&id=$2 - /folder1/blogs/folder2 is sent as /sites/blog/php?url=folder1&id=folder2
what do you mean by folder path here ??? please check this: (in above urls i specified) when users types the following url, somesite.com/akildeoza/blogs, the url (/sites/blog.php?url=$1) is correctly retrieving akildeoza value whereas in somesite.com/akildeoza/blogs/1 , the url is retrieving some other value like url/sites/blog.php , actually it should get the value akildeoza. you got clear ???
akildeoza is a folder no? akildeoza/blogs == /sites/blog.php?url=akildeoza akildeoza/blogs/1 == /sites/blog.php?url=akildeoza&id=1 you need to check blogs.php to see that it is making the path correctly for $url/blogs/$id/ print the error message here may help also
no, there is no akildeoza folder in server. thats the reason i've written the above htaccess rewrite code.which will automatically retrieve data from sites/blog.php using the url parameter thing is, 2nd line htaccess code messup with the 1st line of code,as they are similar. need to fix this.
Thanks for your suggessions @i8k. Finally after some trials, found the solution. combined these 2 lines : RewriteRule ^(.*)/blogs /sites/blog.php?url=$1 RewriteRule ^(.*)/blogs/(.*) /sites/blog.php?url=$1&id=$2 to single line :Â RewriteRule ^(.*)/blogs(/?)(.*) /sites/blog.php?url=$1&id=$3 now it works perfectly