httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ajai Khattri <>
Subject Re: [users@httpd] YAMRQ (Yet Another Mod Rewrite Question)
Date Thu, 04 Oct 2007 12:16:04 GMT
On Thu, 4 Oct 2007, Christian Folini wrote:

> I am missing the context. :)
> Please provide your whole config. I think it has to
> do with the structure of your config file.

This is the .htaccess file:

Options +FollowSymLinks +ExecCGI

<IfModule mod_rewrite.c>
  RewriteEngine On

  # redirect creation and editing actions
  RewriteCond %{HTTP_HOST} ^www\.example\.com [NC]
  RewriteCond %{REQUEST_URI} ^/create$
  RewriteRule (.*) [R,L]

  RewriteCond %{HTTP_HOST} ^www\.example\.com [NC]
  RewriteCond %{REQUEST_URI} ^/edit/(.*)$
  RewriteRule (.*)$1 [R,L]

  # likewise, redirect back for actions that are NOT edit/create
  # this doesn't work
  #RewriteCond %{HTTP_HOST} ^edit\.example\.com [NC]
  #RewriteCond %{REQUEST_URI} !^/create$
  #RewriteCond %{REQUEST_URI} !^/edit/(.*)$
  #RewriteRule (.*)$1 [R,L]

  # for TinyMCE and images folder
  RewriteRule ^js/tiny_mce/plugins/imagemanager/(.*)$ - [L]
  RewriteRule ^images\/(.*)$ - [L]

  RewriteCond %{REQUEST_URI} \..+$
  RewriteCond %{REQUEST_URI} !\.html$
  RewriteRule .* - [L]

  # we check if the .html version is here (caching)
  RewriteRule ^$ index.html [QSA]
  RewriteRule ^([^.]+)$ $1.html [QSA]
  RewriteCond %{REQUEST_FILENAME} !-f

  # no, so we redirect everything else to our front web controller
  RewriteRule ^(.*)$ index.php [QSA,L]

# big crash from our front web controller
ErrorDocument 500 "<h2>Application error</h2>application failed to start properly"
ErrorDocument 401 /error/401.html


The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:> for more info.
To unsubscribe, e-mail:
   "   from the digest:
For additional commands, e-mail:

View raw message