No! I am not trying to develop a facebook or myspace, but yes, I have the need for my users to create their own "landing page". I have no clue how to do this in MODx.
I am migrating an existing site to MODx and do not know how to create the page to dynamically generate a landing page that would be unique to the user. I have an existing database and they have a unique ID or affiliate number. In the past, they would direct traffic to the site by just telling people their ID number, or sending them a link that was formatted like this:
www.mydomain.com/?ID=101
Obviously, this can be done better. I would like to have it formatted like this:
www.mydomain.com/member/101
or even
www.mydomain.com/member/unique_identifier_of_the_users_choosing
If i just went into the rewrite rules and created that rule and it worked, then that would be great, but I do not know how to structure the files in MODx to make this possible.
Any help would be appreciated.
This is tricky if you want to continue using the users’ existing id numbers since they don’t correspond to anything MODx would understand.
The WebLoginPE snippet will direct the user to their own personal landing page on login and you might be able to modify it to look in a lookup table that would let you go from your user ID to a MODx document ID, which is what it uses for the redirection. The MODx document IDs are generated as the pages are created and it’s unwise to set them or change them.
Each page in MODx has an alias and you can configure things so that the URL shows as yoursite.com/alias. All this assumes that you’re willing to create new MODx documents for each users page(s) rather than just having the raw existing HTML files which won’t mesh very well with the MODx site.
The optimum way to do what you want will depend somewhat on how many users you have and whether it’s practical to hand-edit all their pages to put in the alias and/or if you’d be willing to have them re-register using WLPE. The best thing in the long run might be to create new MODx documents and assign the users new IDs based on the document id of their new pages on the MODx site.
Hope this makes sense.
Others may have better suggestions.
I think that I may have found a workaround, but I am not good enough at Mod Rewrite to know what to do.
I have created a page that is now a container so the url is:
www.exampledomain.com/containerPage
Now all I need to do is tell the Mod Rewrite to look for any numbers after the trailing slash. So if the new url should be:
www.exampledomain.com/containerPage/101
The Mod Rewrite would see that the last 3 digits was actually a variable and would redirect the page to:
www.exampledomain.com/containerPage?var=101
Then I could use GET within the snippet to process the request and display the dynamic content from the other database.
If I am way far off, please let me know, but if not, please assist me in the Mod Rewrite instructins to make this possible.
Thanks in advance.
I have created a fix in the .htaccess file... here is what I did:
RewriteRule ^cause/([^/]*)$ /cause.html?cause=$1 [R=301,L]
if anyone can come up with a better solution, I would love to see it.
Thanks