I have the following lines in my
.htaccess (there are other lines but these two are next to each other)
RedirectMatch 301 ^/datingstories https://example.com/blog/category/relationships/datingstories/ RewriteRule ^([a-zA-Z0-9_-]+)$ showprofile.php?username=$1
- There is a WordPress blog component to the site (under
/blog) as well as a membership and profile pages built outside of WordPress.
- The first line is a simpler way to access a specific set of blogs in a sub-category i.e.
https://example.com/datingstoriestranslates to the dating sub-category of the blog. This is also shared externally (which is why I wanted the shorter URL)
- The second line translates sitename/username to
sitename/showprofile.php?username=username. There are member profile pages on the site and the URL is simplified (i.e.
https://example.com/showprofile.php?username=frank). However, the URL on the browser shows
The issue is when
https://example.com/datingstories is click/linked to, the resulting URL is
While the page still loads, is there any way of preventing the
?username=dating from showing as part of the resulting URL. I think the second
.htaccess rule is being applied but I am not sure how since
showprofile.php is not showing up in the resulting URL.
Also, ideally, it would be great if the resulting page shows the shorter URL rather than the longer one.
I appreciate your time in looking and responding to this.