简体   繁体   中英

redirecting apache to a different module

i currently have an apache module which when invoked performs a number of operations one of which is to modify a URL in the form of a string. I would subsequently like to redirect to this URL. Unfortunately there is not much documentation available to help me accomplish this, can someone who has done similar please advise?

thanks in advance

You can use the apr_table_add function with headers_out, that holds the response headers.

apr_table_add(r->headers_out, "Location", your_url);

return HTTP_MOVED_PERMANENTLY;

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM