![]() |
| Creating file path... |
|
Ennio
|
I have a question, I'm creating a website where users will have their own page on the website for example.
Once you register on our website you will get a link like this "http://www.yyyy.com/Myname" Do I need to create one folder for each user, or is there a way to map a page to display like that. http://wwww.yyyy.com/index.cfm?id=9999 can it be http://www.yyyy.com/Myname ? |
||||||||||||
|
|
|||||||||||||
|
pmeserve
HostMySite Tech
|
If you were using Rails I believe this would be pretty easy to setup with routing
The main problem I see w/ CF is unless you're on Linux, I can't think of a way to funnel all requests into a specific script that could load data in this way. If you could setup a funnel like that, then you'd basically just push any request into routing.cfm, which would then load user-specific data based off the path from the URL passed in Other people here can probably help better with the exact code, but that would be the general idea |
||||||||||||
|
|
|||||||||||||
| Rails & CF |
|
comprug
Forum Regular
|
|
|||||||||||||
|
|
||||||||||||||
|
Ennio
|
humm ok I'm not familiar with that I think what I would do is when the user register on the site, I will create a folder with his username, than I could have http://www.yyyy.com/Hisname
easier... |
||||||||||||
|
|
|||||||||||||
|
pmeserve
HostMySite Tech
|
Ennio - You could do that, and assuming the page the user creates is all static, user-created content, it probably wouldn't be a bad solution. But let's say each page needs some dynamic or default content, like using standardized templates, etc. - now you wind up creating x copies of the same code, one in each user's folder. Then the day comes you want to change that code, and instead of using some sort of routing system & changing it in one place, you need to now update the copy for each users site
It's really a question of what you need the setup for |
||||||||||||
|
|
|||||||||||||
|
Ennio
|
yeah that is true...
Where I can find information on how to use rails? Becuase most of the sites I have we change it every year, so that will be a pain to do using folders.... |
||||||||||||
|
|
|||||||||||||
| It will be a tough switch |
|
comprug
Forum Regular
|
Ennio,
Unfortunately switching to Rails would be much better in the long run because it will increase productivity, stability, and give you this kind of URLs, but in the short term, it will require porting your Coldfusion app, and switching plans. You can find out more about Rails at rubyonrails.org. Sorry if we couldn't address your problem in Coldfusion. I used to be a Coldfusion user, and struggled from the same problem, and while it was hard in the short term, I had much more possibilities with Rails. |
||||||||||||
|
|
|||||||||||||
|
Ennio
|
I found a solution I will create one folder for every user, and on the folder I will have a page with a single <cfinclude> that will get the script I need, so if I need to change latter I can change a single page, and not all the pages...
One question... what is Ruby on Rails? is this a new web language? I'm still in college and it would be good to leaner something new.... |
||||||||||||
|
|
|||||||||||||
| Ruby on Rails |
|
comprug
Forum Regular
|
Models are the files that keep track of relations between tables, validate data, and create callbacks. For example, if you have a teachers table and a students table, you can create a teacher.students method giving you all of a teacher's students simply by specifying has_many :students in the teacher model, and belongs_to :teacher in the student model. The controller processes requests, and the view controls layout and design from the data from the controller. Even though CF is a great application, Rails is much easier to program with, and debug, and Ruby doesn't have any twists; everything is expected and seems to flow naturally. One book I recommend is Agile Web Development with Rails 2nd Edition. |
|||||||||||||
|
|
||||||||||||||
| Creating file path... |
|
||
|


