Forum Discussion
Help Please
i want to change url with irule
for example;
https://www.abc.com/1234.aspx to https://www.abc.com ( i want to remove url extension)
please help me.
tnx.
2 Replies
- Kevin_Stewart
Employee
It's important to understand that a URI will always exist, even if it's just "/". So the simplest approach may simply be to change the URI:
when HTTP_REQUEST { HTTP::uri "/" }This will change the URI transparently (the client won't see the change). If you do actually want the client to see the change, then something like this:
when HTTP_REQUEST { if { not ( [HTTP::uri] equals "/" ) } { HTTP::redirect "/" } }Be forewarned though that both methods can have consequences. If the application isn't designed to handle these changes, or perhaps the application has other URIs that shouldn't be rewritten, then the iRule could get a bit more complex. If you just want to hide the "/1234.aspx" URI from the client, that may not be easy. What if other URIs exists (ex. /5678.aspx, /images/mycat.png, etc.)? You have to have a way for the client to indicate what it wants.
- Serkan_HL_16562
Nimbostratus
Hi Kevin,
Thank you for your help. I tried your script you sent. this script is running. but website content is not displayed.
I want exactly this: https://www.abc.com/1234.aspx to(remove from / after) https://www.abc.com exactly i want to just remove 1234.aspx.
I hope I could explain it to you.
best regards tnx.
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)Recent Discussions
Related Content
* Getting Started on DevCentral
* Community Guidelines
* Community Terms of Use / EULA
* Community Ranking Explained
* Community Resources
* Contact the DevCentral Team
* Update MFA on account.f5.com