Background: I'm creating a website through Shiny. I'm making use especially of the shiny.router package to enable linking between webpages and tabs in the Shiny app. The shiny.router routing logic wraps the whole website. I'm using RStudio.
Problem: I'm trying to add a link to a website external to my Shiny app, using tags$a(). When I try clicking the link, I get a "not found" error. I've found that this is because it appends "./#!/" to the link I've provided. For example, instead of going to "www.google.com" tries to go to "./#!/www.google.com" Since this processing happens when the R code is converted to html, I'm unsure where to intervene and remove the appended portion.
Possible causes: I have a few clues as to what's happening, I think it could be related to the router package I'm using or the fact that I run my app with shinyAppDir("."). I've had to run my app with shinyAppDir(".") because it has a lot of trouble accessing the images I have stored in my www folder without it. I did try commenting the shinyAppDir(".") portion out and running the app without it, however, the links still don't work and the photos and other media files I have don't appear consistently. Please let me know if there's a better solution to the photo issue. I'm not sure what's causing it as certain mediafiles are accessed while others aren't, despite being located in the same www folder and being of the same file type and having similar file sizes. Rstudio also seems to 'see' these files: they appear in the working directory panel. Could this be related to the issue I'm having with routing?
Is there some kind of other rShiny tag or function that allows for specifying an external link? Do you know what might be causing Shiny to append "./#!/" to the href I'm providing?
target="_blank"in the link) seems to help.