开发者

snow leopard, mod_rewrite, codeigniter

开发者 https://www.devze.com 2022-12-09 16:51 出处:网络
hay guys, i\'m having all sorts of mod_rewirte trouble in snow leopard. Anyone know any decent articles focused on snow leopard and mod_rewrite? Or perhaps a simple step by step guide. What i want to

hay guys, i'm having all sorts of mod_rewirte trouble in snow leopard. Anyone know any decent articles focused on snow leopard and mod_rewrite? Or perhaps a simple step by step guide. What i want to do is setup codeigniter so the urls looks 'pretty'.

so

localhost/~myusername/ci_app/index.php/mycontroller/myaction

would become

localhost/~myusername/ci_app/mycontroller/myac开发者_Go百科tion

thanks


Per CodeIgniter documentation, you should use:

RewriteEngine on
RewriteCond $1 !^(index\.php|images|robots\.txt)
RewriteRule ^(.*)$ index.php/$1 [L]


Try this rule:

RewriteEngine on
RewriteBase /~myusername/ci_app/
RewriteRule ^[^/]+/[^/]+$ index.php/$0 [L]
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号