lilmer Posted March 14, 2016 Share Posted March 14, 2016 I've got a URL http://sub.domain.com/index.php?aggrement I am having a problem trying to change this to through IIS rewrite http://sub.domain.com/index.php/aggrement or http://sub.domain.com/aggrement and another question throught chaging.. is this can be rewrite without redirecting and load the controller directly " aggrement controller" I'm using codeigniter 3 as php framework. Thank you Quote Link to comment https://forums.phpfreaks.com/topic/301000-url-rewrite-problem/ Share on other sites More sharing options...
requinix Posted March 14, 2016 Share Posted March 14, 2016 What does your web.config look like? Quote Link to comment https://forums.phpfreaks.com/topic/301000-url-rewrite-problem/#findComment-1532001 Share on other sites More sharing options...
lilmer Posted March 15, 2016 Author Share Posted March 15, 2016 I have tried to use this rule but ai'nt working as others as well.. is the issue with ?aggrement.. as it identify it as Get request. <rule> <match url="http://sub.domain.com/index.php?aggrement" /> <action type="Rewrite" url="http://sub.domain.com/index.php/aggrement" /> </rule> Quote Link to comment https://forums.phpfreaks.com/topic/301000-url-rewrite-problem/#findComment-1532013 Share on other sites More sharing options...
requinix Posted March 15, 2016 Share Posted March 15, 2016 The URL is only the path portion. You probably don't need to concern yourself with the domain, so really all you need is to match the index.php and add a condition for the query string. <rule> <match url="^index\.php$" /> <conditions logicalGrouping="MatchAll"> <add input="{QUERY_STRING}" matchType="Pattern" pattern="^aggrement$" /> </conditions> <action type="Rewrite" url="index.php/aggrement" appendQueryString="false" /> </rule>I think. That does a rewrite - the user doesn't get redirected. If you want a redirection then use a "Redirect"-type action. Reference Quote Link to comment https://forums.phpfreaks.com/topic/301000-url-rewrite-problem/#findComment-1532019 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.