[aur-dev] [PATCH] Added RewriteRule for Apache
--- INSTALL | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/INSTALL b/INSTALL index d682eda..190bc0d 100644 --- a/INSTALL +++ b/INSTALL @@ -89,4 +89,10 @@ Setup on Arch Linux: $ cd ~/aur/web/lib/ $ cp config.inc.php.proto config.inc.php + In case you set $USE_VIRTUAL_URLS to true (default nowadays) you should add + a rewrite rule. For Apache, add this ~/aur/web/html/.htaccess: + + RewriteEngine on + RewriteRule ^(?!index\.php/.*)(.*)$ /index.php/$1 + 8) Point your browser to http://aur -- 1.8.0.1
On Fri, Dec 07, 2012 at 10:54:48PM +0100, Marcel Korpel wrote:
--- INSTALL | 6 ++++++ 1 file changed, 6 insertions(+)
diff --git a/INSTALL b/INSTALL index d682eda..190bc0d 100644 --- a/INSTALL +++ b/INSTALL @@ -89,4 +89,10 @@ Setup on Arch Linux: $ cd ~/aur/web/lib/ $ cp config.inc.php.proto config.inc.php
+ In case you set $USE_VIRTUAL_URLS to true (default nowadays) you should add + a rewrite rule. For Apache, add this ~/aur/web/html/.htaccess: + + RewriteEngine on + RewriteRule ^(?!index\.php/.*)(.*)$ /index.php/$1
Can't we use something like "RewriteRule ^(.*)$ /index.php/$1 [L]" here? Under lighttpd, following config works: url.rewrite-once = ( "^(.*)$" => "/index.php/$1" ) On alderaan, following nginx rule is used: location ~ .* { rewrite ^/(.*)$ /index.php/$1 last; }
+ 8) Point your browser to http://aur -- 1.8.0.1
On Sat, Dec 8, 2012 at 12:03 AM, Lukas Fleischer <archlinux@cryptocrack.de> wrote:
On Fri, Dec 07, 2012 at 10:54:48PM +0100, Marcel Korpel wrote:
+ RewriteRule ^(?!index\.php/.*)(.*)$ /index.php/$1
Can't we use something like "RewriteRule ^(.*)$ /index.php/$1 [L]" here?
I tried that first, but it creates a loop somewhere. When I try a redirect and access http://aur I'm redirected to http://aur/index.php/index.php/index.php/index.php/index.php/index.php/index... To prevent this looping, we need the (?!index\.php/.*) part. Regards, Marcel
On Sat, Dec 8, 2012 at 12:03 AM, Lukas Fleischer <archlinux@cryptocrack.de> wrote:
Can't we use something like "RewriteRule ^(.*)$ /index.php/$1 [L]" here?
I looked at this again, and found this in the documentation: "If you are using RewriteRule in either .htaccess files or in <Directory> sections, it is important to have some understanding of how the rules are processed. The simplified form of this is that once the rules have been processed, the rewritten request is handed back to the URL parsing engine to do what it may with it. It is possible that as the rewritten request is handled, the .htaccess file or <Directory> section may be encountered again, and thus the ruleset may be run again from the start. Most commonly this will happen if one of the rules causes a redirect - either internal or external - causing the request process to start over." http://httpd.apache.org/docs/current/rewrite/flags.html#flag_l A more clear solution is: RewriteEngine on RewriteCond %{REQUEST_URI} !^/index.php RewriteRule ^(.*)$ /index.php/$1 I'll submit a new patch. Regards, Marcel
participants (2)
-
Lukas Fleischer
-
Marcel Korpel