I’d like for the URL path to match the URL of the section of the site, like this:
Path to section of site -> http://site.com/news/
Path to file download -> http://site.com/news/download/file.pdf
Is there a way to do this?
This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.
The active forums are here.
June 29, 2012 11:36am
Subscribe [2]#1 / Jun 29, 2012 11:36am
I’d like for the URL path to match the URL of the section of the site, like this:
Path to section of site -> http://site.com/news/
Path to file download -> http://site.com/news/download/file.pdf
Is there a way to do this?
#2 / Jun 29, 2012 11:38am
That’s really not how EE wants to work with URLs. If EE sees /news/download it’s going to look for a download template in the news template group.
You’re really kind of mixing virtual paths (that EE uses past index.php to know how find templates and pull content) with actual server paths where files get stored.
Is this a requirement or just a “nice to have”? I’m not sure users notice/mind if a download comes from a different directory than the current page appears to be in.
#3 / Jun 29, 2012 11:45am
My client will be putting the path to this file in some marketing-rich areas, so having the path relate to this section of the site is wanted from a marketing perspective. If it’s a section of a site related to a conference, it’d be nice if the path to download the file matched the url path to that same section of the site.
#4 / Jun 29, 2012 11:48am
How about this…
Create a folder in the root directory of the site that matches the path to that section of the site and putting the file in there. I know this works ‘cause I just did it. 😊
My question is this: do i run the risk of messing something else up by doing it this way?
#5 / Jun 29, 2012 11:51am
I think I just answered my own question. Using an actual folder in root directory that matches the path name of a section of the site kills the path and redirects to the home page.
Can’t do that.