I understand php is not the right forum to discuss this, but apache forum has no active users which made me come here. Kindly help me with this simple workaround. I am working on a small site where I need to convert dynamic url to static one whose variations are as below. Dynamic url Note that Page 1 does not have the page number attribute in the url and directly it should be taken as 1 by default. The static url I want is for 1st page it will be Thanks a lot for the help in advance Hope to see quick replies.
Hello, Try this: RewriteEngine on RewriteRule topic/(.*?)/(.*?)/$ cat.php?catslug=$1&page=$2 RewriteRule topic/(.*?)/$ cat.php?catslug=$1&page=1 Code (markup):
Just a note, that .htaccess would be placed at the root of your site, but if you wanted to place it in a folder called topic you'd do something like this: RewriteEngine on RewriteRule (.*?)/(.*?)/$ cat.php?catslug=$1&page=$2 RewriteRule (.*?)/$ cat.php?catslug=$1&page=1 Code (markup):