Jun 29, 2013

Codeigniter on Alternate Port

Rather than using sub path, I deploy my web on alternate port. But this is also not normally supported in Codeigniter. So here's how I do it.

Add this in /.htaccess:
RewriteCond %{SERVER_NAME} localhost
RewriteCond %{SERVER_PORT} 80
RewriteRule ^%{SERVER_NAME} %{SERVER_NAME}:8000?/$1 [R,NC]

And this as site name:
localhost:8000

Now it works just as on real domain and real port, http port 80 that is.
Post a Comment