CodeIgniter Forums
Htaccess config to create page redirection - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Using CodeIgniter (https://forum.codeigniter.com/forumdisplay.php?fid=5)
+--- Forum: General Help (https://forum.codeigniter.com/forumdisplay.php?fid=24)
+--- Thread: Htaccess config to create page redirection (/showthread.php?tid=70946)



Htaccess config to create page redirection - laxernadayo - 06-19-2018

May I know what is the meaning of each lines in htaccess whenever a page is redirected? Thanks

RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [L]


RE: Htaccess config to create page redirection - Pertti - 06-20-2018

Code:
RewriteEngine On
Enable Apache webserver URL rewrite feature

Code:
RewriteCond %{REQUEST_FILENAME} !-f
If URL is not actual file ...

Code:
RewriteCond %{REQUEST_FILENAME} !-d
... and URL is not actual directory ...

Code:
RewriteRule ^(.*)$ index.php/$1
... then take URL and return output of index.php script instead, using URL as one of attributes for index.php


Here's more detailed explanation of URL rewrite
https://www.addedbytes.com/blog/url-rewriting-for-beginners