Support Forums
Development Forum
url_rewrite not working as expected
You must be signed-in to post.
| Author | Subject | |
|---|---|---|
| Page: 1 | ||
havardp![]() | Subject: url_rewrite not working as expected | |
| For our assignment question type for the test module we generate a download link with the following code: <a target="new" href="<?php echo url_rewrite('tools/tests/download.php?fid='.$this->answer['file_id'], AT_PRETTY_URL_IS_HEADER); ?>"><?php echo _AT('Download'); ?></a> But the url_rewrite function strip ".php" from the script name, so we end up with a 404 error. Posted: 2009-08-31 09:19:26 | ||
havardp![]() | Subject: Re: url_rewrite not working as expected | |
| Just wanted to add that we have pretty urls turned on. Posted: 2009-08-31 09:21:04 | ||
harris![]() | Subject: Re: url_rewrite not working as expected | |
| Hello, Do you have mod_rewrite on as well? Posted: 2009-08-31 10:03:10 | ||
havardp![]() | Subject: Re: url_rewrite not working as expected | |
| Yes, we have. But I don't see how url_rewrite should translate the URL different. Posted: 2009-09-01 04:10:36 | ||
harris![]() | Subject: Re: url_rewrite not working as expected | |
| We have several rules in .htaccess file to rewrite the url to a shorter form. So, one of the rules that I have in the .htaccess might take out .php if it thinks that it is part of the 'pretty url'. Feel free to adjust the .htaccess rule for your own system. Posted: 2009-09-02 11:47:27 | ||
havardp![]() | Subject: Re: url_rewrite not working as expected | |
| I'm having problems with the url_rewrite() function in the ATutor API, not the mod_rewrite rules in .htaccess. Posted: 2009-09-03 02:29:33 | ||
harris![]() | Subject: Re: url_rewrite not working as expected | |
| Could be a bug in the rewrite class, i will check that. Posted: 2009-09-03 09:10:49 | ||
harris![]() | Subject: Re: url_rewrite not working as expected | |
| To shorten the URL, some of them have the .php being taken out. Though, the condition seems to be imperfect. You can add another condition in line 272 to by pass your code for now. under include/classes/UrlRewrite/UrlRewrite.class.php Posted: 2009-09-03 09:40:29 | ||
| Page: 1 | ||
You must be signed-in to post.



