Hi,
We need to have a public site separately while updating the content through another site with the same database.
For the Public site, Users can browse the content of the site. (example.com) Users can not log in as a user and authentication has been blocked. Users cannot go to the login page or login to this site. It is for the public view only.
The second site(admin.example.com) will use the same database and the admin will update the content. It has the authentication.
Please, can I know how to do this? I appreciate your support.
Thank you!
Hello:
It sounds like you can accomplish this by creating two websites on the same DNN instance.
Then, you'd want to have some sort of routing or rules in place to be sure that only those who should see the "admin" site will be able to.
This can be done a number of ways, but I'd suggest using two redundant methods. In this case, I'd first look at applying a redirectRule in the web(dot)config, and another in your website firewall. This way, if one fails for any reason, the other is still in place.
redirectRule
Once you have the two sites created, you'll want to link them using the Site Groups feature in the persona bar. This will allow you to have and use shared content between the two sites. This way, you can either have "primary" copies of the content on the admin site that feeds the public site, or... You can have the two sites be duplicates and still do the same thing. In this case, though, it would be easier to know and see what the impacts of the changes would be since the site is an exact copy.
(The first example would be faster, using a utilitarian (back-office) approach where you'd simply see content everywhere to edit, without the context and design.)
As you build out the "admin" site, you'd begin adding an existing module to the "public" site. As long as the two sites exist and they're grouped, you'll be able to select modules from the "admin" site to place as a linked copy on the "public" site.
The big caveat here is that you need to be very selective when building and choosing modules for this kind of implementation. They need to support content sharing. You should be able to reach out to the respective vendor(s) for any third-party/custom extensions you plan to use and ask them.
Good luck!
There is another possibility to accomplish this if you need to devide the two websites completely in different folders, but it is a bit tricky, and since a while the DNN installer has no more interface for that.
The idea is to use a so called "Object Qualifier", at least for one site. This has to be defined before the start of installation, by setting the objectQualifier attribute in the web(dot)config file.
<add name="SqlDataProvider" type="DotNetNuke.Data.SqlDataProvider, DotNetNuke" connectionStringName="SiteSqlServer" upgradeConnectionString="" providerPath="~\Providers\DataProviders\SqlDataProvider\" objectQualifier="" databaseOwner="dbo" />
The object qualifier is a string, e.g. "site2". What it does is it puts the string in front of the database objects, the table "Users" becomes "site2_Users", the stored procedure "GetAllUsers" becomes "site2_GetAllUsers" etc.
This explains the specific SQL syntax in DNN installation scripts or the SQL Console, like
SELECT * FROM {databaseOwner}{objectQualifier}Users
Happy DNNing! Michael
Michael TobischDNN★MVP
Posted By Michael Tobisch on 3/8/2024 1:03 AM Thanks Daniel, I did not know it is "deprecated". Happy DNNing! Michael
Yeah, it will be removed at some point in the future, but I still make sure to include it everywhere until then. Just in case...
Posted By Michael Tobisch on 3/8/2024 4:03 AM Thanks Daniel, I did not know it is "deprecated". Happy DNNing! Michael
Yeah, so "deprecated" is a big word and we don't have a nice way to migrate forward migrating sites that use it. So it could be supported forever but let's say it is not recommended :) It was useful at a time when having more than one database would incur expensive hosting.
These Forums are dedicated to the discussion of DNN Platform.
For the benefit of the community and to protect the integrity of the ecosystem, please observe the following posting guidelines:
Awesome! Simply post in the forums using the link below and we'll get you started.