.htaccess mod_rewrite help

Status
Not open for further replies.

Berk

berkibap#4233
Developer
Oct 17, 2015
863
190
Hello everyone.

I'm trying to fuck with .htaccess but I can't get it working.

So what I want to do is,
raw link is #!/profile?username={usernamegoeshere}
I want it to be like,
#!/profile/{usernamegoeshere}

So what I've tried:
Code:
 RewriteRule ^#!/profile/(.*)/(.*)/$2 #!/profile?username=$2

Any help appreciated. Thanks.
 

Viper

Member
Dec 10, 2011
35
8
Try the following code.
Code:
RewriteRule ^profile/([a-zA-Z0-9_-]+)(|/)$ index.php?url=profile&user=$1

And then add this to your web config

<rule name="Imported Rule 7">
         <match url="^profile/([a-zA-Z0-9_-]+)(|/)$" ignoreCase="false" />
         <action type="Rewrite" url="index.php?url=profile&amp;user={R:1}" appendQueryString="false" />
</rule>
Currently I have those working.
 
Status
Not open for further replies.

Users who are viewing this thread

Top