Uncategorized

Nginx Server configuration for rewrite

If you have domain or host for instance ataraza.com and you want to run codeigniter in sub folder like /{root}/subfolder1/subfolder2/codeigniter then add follow configuration in /etc/nginx/sites-available/default.

location /subfolder1/subfolder2/codeigniter/
{
if ($request_uri ~ “^system.*”){
rewrite ^/subfolder1/subfolder2/codeigniter/(.*)$ /subfolder1/subfolder2/codeigniter/index.php?/$1 last;
}
if (!-e $request_filename){
rewrite ^/subfolder1/subfolder2/codeigniter/(.*)$ /subfolder1/subfolder2/codeigniter/index.php?/$1 last;
}
}

Sudo commands are

sudo nano /etc/nginx/sites-available/default (To Edit default configuration file. Use shortcut ctrl+o to write and ctrl+x to save with Y and exit with enter)

sudo service nginx restart (To restart nginx after the changes)

Five Mostly use PHP design patterns

Design patterns were introduced to the software community in Design Patterns, by Erich Gamma, Richard Helm, Ralph Johnson, and John Vlissides (colloquially known as the “gang of four”). The core concept behind design patterns, presented in the introduction, was simple.