urlManager redirect/alias

Hello Everyone,

Please help me regarding urlManager. How to redirects to other domain/directory while request is /blog. :unsure:

See what I actually want:




'rules' => array(

	'/blog' => 'wordpress/index.php', /* Here wordpress is a directory inside project root path on same domain */

)

/*

 * Here blog is Alias of wordpress

 * If url visits http://www.myxdomain.com/blog then it actually works as alias of http://www.myxdomain.com/wordpress/

 */



Can I do this with urlManager of .htaccess Alias

Thanks in Advance :rolleyes:

Hi

I’m not sure, that you can do with the urlManager such a thing.

Why don’t you use an apache rewrite, or a redirect from a controller?

Thanks odoaker,

I did that but Apache RewriteRule is not applying take a look:




RewriteRule ^blog/([a-zA-Z0-9_&',\-_=/]*)$ wordpress/index.php?%{QUERY_STRING}



Is this the first rewrite, because the order matters? And there are two missing ‘/’.




RewriteRule ^/blog/([a-zA-Z0-9_&',\-_=/]*)$ /wordpress/index.php?%{QUERY_STRING} [L]