Basically, I was wondering if I could take a url like:
http://tai.tskynet.com/?id=book
and rewrite it to
like a "fake" folder.
What should I write?
Basically, I was wondering if I could take a url like:
http://tai.tskynet.com/?id=book
and rewrite it to
like a "fake" folder.
What should I write?
First, you have to make sure that your rewrite_module and dir_module is enabled in apache. Then check your httpd.conf file to make sure that these lines exist:
LoadModule rewrite_module modules/mod_rewrite.so
LoadModule dir_module modules/mod_dir.so
Then set the value for DirectoryIndex
to include the target file (index.php as example)
<IfModule dir_module>
DirectoryIndex index.php ...
</IfModule>
Here is the .htaccess file:
RewriteEngine on
RewriteCond $1 !^(index\.php|robots\.txt|assets|uploads|cloudfront\.php)
RewriteRule ^(.*)$ index.php/$1 [L]
This would forward your URI values to the target file [index.php] then process it there.
In the example, robots\.txt|assets|uploads|cloudfront\.php
will not be forwarded to index.php and instead will be treated as normal directory requests.