Jump to content

URL Rewrite Problem


lilmer

Recommended Posts

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

 

 

Link to comment
Share on other sites

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>
Link to comment
Share on other sites

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

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.