jgd12345 Posted October 1, 2007 Share Posted October 1, 2007 Hi i'm trying to create a rewrite 2 rewrite rules one which goes to index.php and one that goes to info.php. Here's some examples of urls which should go to index.php: /news/ (with or without trailing slash) /news/cat1/ (with or without trailing slash) /news/cat1/sub1/ (with or without trailing slash) /news/cat1/sub1/index.htm Here's some examples of urls which should go to info.php: /news/page.htm /news/cat1/page.htm /news/cat1/sub1/page.htm So far i have: RewriteRule ^news/?(.*?)?/?(index\.htm)?$ /news/index.php [NC,QSA,L] RewriteRule ^news/(.*?)\.htm$ /news/info.php [NC,QSA,L] But the first rule picks up any urls for the second rule aswell so /news/index.php is always shown. If i change the first rule to (removing the ? after the last /): RewriteRule ^news/?(.*?)?/(index\.htm)?$ /news/index.php [NC,QSA,L] It works but means that i must specify a trailing slash which is not what i am after. Really appreciate if someone could help. Thanks Quote Link to comment https://forums.phpfreaks.com/topic/71365-help-with-rewrite-rules/ Share on other sites More sharing options...
jgd12345 Posted October 3, 2007 Author Share Posted October 3, 2007 No one :'(. Plzzzzzz (all them z's making me tired) Quote Link to comment https://forums.phpfreaks.com/topic/71365-help-with-rewrite-rules/#findComment-360764 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.