web.config Subpage

MarcusDev

Just trying to get it working
Nov 10, 2015
22
2
Hello DevBest :)
ok, so I wanted to create a sub-page from the menu on the page.

The goal is to make it so that if one enters the url / community / event
then they will be transferred to the event page.
VSbT6.png

Here is an example of how I want it to look like. I'll just replace experts with event.

I do not know, but I think web.config has something to do with this, then here is the source code.
Code:
<?xml version="1.0" encoding="UTF-8"?>


<configuration>
<system.webServer>
<rewrite>
<rules>
<rule name="Imported Rule 1">
<match url="^(|/)$" ignoreCase="false" />
<action type="Rewrite" url="index.php?url={R:1}" appendQueryString="false" />
</rule>
<rule name="Imported Rule 2">
<match url="^([a-zA-Z0-9_-]+)(|/)$" ignoreCase="false" />
<action type="Rewrite" url="index.php?url={R:1}" appendQueryString="false" />
</rule>
<rule name="Imported Rule 3">
<match url="^(.*)\.htm$" />
<action type="Rewrite" url="{R:1}.php" />
</rule>
<rule name="Imported Rule 4">
<match url="^(|/)$" ignoreCase="false" />
<action type="Rewrite" url="dash.php?page={R:1}" appendQueryString="false" />
</rule>
<rule name="Imported Rule 5">
<match url="^([a-zA-Z0-9_-]+)(|/)$" ignoreCase="false" />
<action type="Rewrite" url="dash.php?url={R:1}" appendQueryString="false" />
</rule>
<rule name="Imported Rule 1-1">
<match url="^(|/)$" ignoreCase="false" />
<action type="Rewrite" url="index.php?url={R:1}" appendQueryString="false" />
</rule>
<rule name="Imported Rule 2-1">
<match url="^([a-zA-Z0-9_-]+)(|/)$" ignoreCase="false" />
<action type="Rewrite" url="index.php?url={R:1}" appendQueryString="false" />
</rule>
<rule name="Imported Rule 3-1">
<match url="^(.*)\.htm$" />
<action type="Rewrite" url="{R:1}.php" />
</rule>
<rule name="Imported Rule 4-1">
<match url="^(|/)$" ignoreCase="false" />
<action type="Rewrite" url="dash.php?page={R:1}" appendQueryString="false" />
</rule>
<rule name="Imported Rule 5-1">
<match url="^([a-zA-Z0-9_-]+)(|/)$" ignoreCase="false" />
<action type="Rewrite" url="dash.php?url={R:1}" appendQueryString="false" />
</rule>
<rule name="Imported Rule 9-1">
<match url="^habbo-imaging/badge/([^/]+)$" ignoreCase="false" />
<action type="Rewrite" url="/habbo-imaging/badge.php?badge={R:1}" appendQueryString="false" />
</rule>
<rule name="Imported Rule 10-1">
<match url="^habbo-imaging/head/([^/]+)$" ignoreCase="false" />
<action type="Rewrite" url="/habbo-imaging/head.php?figure={R:1}" appendQueryString="false" />
</rule>
<rule name="Habbo Imaging Group Badges">
<match url="^habbo-imaging/badge/([^/]+)" ignoreCase="false" />
<action type="Rewrite" url="/habbo-imaging/badge.php?badge={R:1}" appendQueryString="false" />
</rule>
<rule name="Habbo Imaging Avatarimage 1">
<match url="^habbo-imaging/avatar/([^/]+)" ignoreCase="false" />
<action type="Rewrite" url="habbo-imaging/avatarimage.php?figure={R:1}" appendQueryString="false" />
</rule>
<rule name="Habbo Imaging Avatar Image 2">
<match url="^habbo-imaging/avatarimage/([^/]+)" ignoreCase="false" />
<action type="Rewrite" url="habbo-imaging/avatarimage.php?username={R:1}" appendQueryString="false" />
</rule>
<rule name="Habbo Imaging Avatar Head">
<match url="^habbo-imaging/head/([^/]+)" ignoreCase="false" />
<action type="Rewrite" url="habbo-imaging/head.php?figure={R:1}" appendQueryString="false" />
</rule>
<rule name="rule 1r">
<match url="^(community/staff)$" />
<action type="Rewrite" url="/staff" />
</rule>
<rule name="rule 2r">
<match url="^(community/experts)$" />
<action type="Rewrite" url="/experts" />
</rule>
<rule name="rule 3r">
<match url="^(community/designers)$" />
<action type="Rewrite" url="/designers" />
</rule>
<rule name="rule 4r">
<match url="^(community/commands)$" />
<action type="Rewrite" url="/commands" />
</rule>
<rule name="rule 5r">
<match url="^home/([a-zA-Z0-9_-]+)(|/)$" />
<action type="Rewrite" url="/index.php?url=home&amp;user={R:1}" />
</rule>
<rule name="rule 6r">
<match url="^user/([a-zA-Z0-9_-]+)(|/)$" />
<action type="Rewrite" url="/index.php?url=home&amp;user={R:1}" />
</rule>
<rule name="rule 7r">
<match url="^profile/([a-zA-Z0-9_-]+)(|/)$" />
<action type="Rewrite" url="/index.php?url=home&amp;user={R:1}" />
</rule>
<rule name="rule 8r">
<match url="^news/([a-zA-Z0-9_-]+)(|/)$" />
<action type="Rewrite" url="/index.php?url=news&amp;id={R:1}" />
</rule>
<rule name="rule 9r">
<match url="^article/([a-zA-Z0-9_-]+)(|/)$" />
<action type="Rewrite" url="/index.php?url=news&amp;id={R:1}" />
</rule>
</rules>
</rewrite>

</system.webServer>

</configuration>
 

JayC

Always Learning
Aug 8, 2013
5,493
1,398
Did you even read the code or did you just copy and paste here..

Example Rule :
<rule name="rule 1r">
<match url="^(community/staff)$" />
<action type="Rewrite" url="/staff" />
</rule>

New Rule:
<rule name="Events">
<match url="^(community/events)$" />
<action type="Rewrite" url="/events" />
</rule>
 

MarcusDev

Just trying to get it working
Nov 10, 2015
22
2
Did you even read the code or did you just copy and paste here..

Example Rule :
<rule name="rule 1r">
<match url="^(community/staff)$" />
<action type="Rewrite" url="/staff" />
</rule>

New Rule:
<rule name="Events">
<match url="^(community/events)$" />
<action type="Rewrite" url="/events" />
</rule>
I've tried it, but it does not work.
 

Users who are viewing this thread

Top