Change URI everywhere?

Using the developer app I can change the URI of profile pages. But, that breaks links to profiles throughout the site.

I want to change this:

/view-persons-profile/user-name

to something easier to remember and type.

  • 136
  • More
Replies (3)
    • Looks like using .htaccess rewrite is the best option.

          RewriteEngine on
          # Rewrite /profile/[anything] to /view-persons-profile/[anything] internally
          RewriteRule ^profile/(.*)$ /view-persons-profile/$1 [L,QSA]
      
      
          # Ensure that requests to /view-persons-profile/[anything] are only accessible via /profile/[anything]
          RewriteCond %{THE_REQUEST} ^[A-Z]{3,}\s/view-persons-profile/[^\s]* [NC]
          RewriteRule ^view-persons-profile/(.*)$ /profile/$1 [R=301,L]
      
      • I would strongly advise against modifying .htacess files in UNA. This has absolutely no effect on how UNA handles links. This is all handled through database.

        https://unacms.com/d/url-rewrites

        This will explain how to do it.

        • Thank you! I followed the instructions and it works great.

          To anyone coming here, follow the above advice. If you don't know how or are scared to edit your database, the .htaccess rules above will work temporarily if you want, at your own risk. But, you have to add them right after the rewrite engine on line. And don't accidentally edit anything else.

          Login or Join to comment.