HTTP authentication logout via PHP

Mu. No correct way exists, not even one that’s consistent across browsers. This is a problem that comes from the HTTP specification (section 15.6): Existing HTTP clients and user agents typically retain authentication information indefinitely. HTTP/1.1. does not provide a method for a server to direct clients to discard these cached credentials. On the other … Read more

.htaccess ErrorDocument 404 not showing up

First, note that restarting httpd is not necessary for .htaccess files. .htaccess files are specifically for people who don’t have root – ie, don’t have access to the httpd server config file, and can’t restart the server. As you’re able to restart the server, you don’t need .htaccess files and can use the main server … Read more

Reference: mod_rewrite, URL rewriting and “pretty links” explained

To understand what mod_rewrite does you first need to understand how a web server works. A web server responds to HTTP requests. An HTTP request at its most basic level looks like this: GET /foo/bar.html HTTP/1.1 This is the simple request of a browser to a web server requesting the URL /foo/bar.html from it. It … Read more

Redirect all to index.php using htaccess

Your rewrite rule looks almost ok. First make sure that your .htaccess file is in your document root (the same place as index.php) or it’ll only affect the sub-folder it’s in (and any sub-folders within that – recursively). Next make a slight change to your rule so it looks something like: RewriteEngine on RewriteCond %{REQUEST_FILENAME} … Read more

How to remove .html from URL?

I think some explanation of Jon’s answer would be constructive. The following: RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d checks that if the specified file or directory respectively doesn’t exist, then the rewrite rule proceeds: RewriteRule ^(.*)\.html$ /$1 [L,R=301] But what does that mean? It uses regex (regular expressions). Here is a little something I made … Read more

CodeIgniter removing index.php from url

Try the following Open config.php and do following replaces $config[‘index_page’] = “index.php” to $config[‘index_page’] = “” In some cases the default setting for uri_protocol does not work properly. Just replace $config[‘uri_protocol’] =”AUTO” by $config[‘uri_protocol’] = “REQUEST_URI” .htaccess RewriteEngine on RewriteCond $1 !^(index\.php|resources|robots\.txt) RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^(.*)$ index.php/$1 [L,QSA] Note: .htaccess code … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)