going nuts over a htaccess redirect problem |
[eluser]quasiperfect[/eluser]
i'm traing to redirect a url like Code: http://localhost/sitemail/site_mail/server/php/site_mail.php?action=value is word of lenght max 9 chars&user_id=value is number of any length&anticash=value is number of any length&anticash=value number of any length Code: http://localhost/mail_handler/value of action/value of user_id my htaccess looks like this Code: Options +FollowSymLinks any idea on how can i achieve this ? i can place a htaccess in the folder sitemail/site_mail/server/php/ if necessarily or i want to redirect any request form the folder sitemail/site_mail/server/php/ to Code: http://localhost/mail_handler/value of param1/value of param2/value of param3
[eluser]TheFuzzy0ne[/eluser]
Just out of interest, why do you need to redirect? Why not write the correct URLs to begin with? For times when you need multiple arguments in no specific order, I wrote an [url="http://ellislab.com/forums/viewthread/106502/"]Alternate URI Syntax library[/url] to help. Would this help you at all? EDIT: It might be possible to do what you want, but can you guarantee that the arguments in the query string will always be in the same order?
[eluser]quasiperfect[/eluser]
@TheFuzzy0ne because the url is not writen by me but a flash aplication (i can't modifi it in any way) that makes requests to a absolute url the parameters are added by flash i'm interested that any request made to the folder http://localhost/sitemail/site_mail/serv...e_mail.php to be redirected to a controller with the values of the first 3 parameters can be done in any way ? i tried placing a htaccess in the folder sitemail/site_mail/server/php Code: Options +FollowSymLinks but i doesn't work
[eluser]TheFuzzy0ne[/eluser]
In your htaccess you're trying to extract from URI segments, and rewrite to a query string. I thought it was meant to be the other way around? Or you could just enable query strings.
[eluser]quasiperfect[/eluser]
problem solved this is a example if anyone has a similar problem let's say we have the folder /a/b/script.php?param1=value1¶m2=value2 u have to place the htaccess file in the folder /a/b/ Code: RewriteEngine on this will redirect the browser to domain/controller/method/value1/value2 the ? at the end of RewriteRule ^script(.*) /controller/method/%1/%2/? removes any other elements from the original url hope it helps somebody
[eluser]TheFuzzy0ne[/eluser]
Well done. Thanks for sharing. Sorry I couldn't be of any more help. |
Welcome Guest, Not a member yet? Register Sign In |