Note that there are some explanatory texts on larger screens.

plurals
  1. POPorting htaccess rewrite rules to hiphop-php config
    primarykey
    data
    text
    <p>I have a CodeIgniter project that requires rewriting rules to navigate controllers/views and the like. I have correctly installed hiphop-php on Ubuntu 12.04 and it works perfectly, including with the sample WordPress installation and rewrite rules provided on their site.</p> <p>However, I need to figure out the proper rewrite rules that will work with the CodeIgniter index.php/controller setup and I haven't had much luck myself.</p> <p>Here is a sample hiphop-php config file for WP rewriting:</p> <p><a href="http://www.hiphop-php.com/wp/" rel="nofollow">http://www.hiphop-php.com/wp/</a></p> <pre><code>VirtualHost { * { Pattern = .* RewriteRules { dirindex { pattern = ^/(.*)/$ to = $1/index.php qsa = true } } } } StaticFile { FilesMatch { * { pattern = .*\.(dll|exe) headers { * = Content-Disposition: attachment } } } </code></pre> <p>And here's a sample CodeIgniter mod_rewrite file for Apache:</p> <p><a href="http://www.farinspace.com/codeigniter-htaccess-file/" rel="nofollow">http://www.farinspace.com/codeigniter-htaccess-file/</a></p> <pre><code>&lt;IfModule mod_rewrite.c&gt; RewriteEngine On RewriteBase / ### Canonicalize codeigniter URLs # If your default controller is something other than # "welcome" you should probably change this RewriteRule ^(welcome(/index)?|index(\.php)?)/?$ / [L,R=301] RewriteRule ^(.*)/index/?$ $1 [L,R=301] # Removes trailing slashes (prevents SEO duplicate content issues) RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^(.+)/$ $1 [L,R=301] ### # Removes access to the system folder by users. # Additionally this will allow you to create a System.php controller, # previously this would not have been possible. # 'system' can be replaced if you have renamed your system folder. RewriteCond %{REQUEST_URI} ^system.* RewriteRule ^(.*)$ /index.php/$1 [L] # Checks to see if the user is attempting to access a valid file, # such as an image or css document, if this isn't true it sends the # request to index.php RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^(.*)$ index.php/$1 [L] &lt;/IfModule&gt; </code></pre> <p>Basically all I need the rewriting to do is route the requests properly with the index.php controller of CodeIgniter, which seems to be what the last part of the apache rewrite rules do. The rest I can hack together after seeing some examples.</p> <p>Thanks a bunch!</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload