Skip to content

Commit 2c6b5a4

Browse files
jclausengitbook-bot
authored andcommitted
GITBOOK-66: change request with no subject merged in GitBook
1 parent 17812d3 commit 2c6b5a4

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

the-basics/routing/requirements/rewrite-rules.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,11 @@ RewriteRule ^(.*)$ - [NC,L]
1818
RewriteRule ^$ index.cfm [QSA,NS]
1919
RewriteCond %{REQUEST_FILENAME} !-f
2020
RewriteCond %{REQUEST_FILENAME} !-d
21-
RewriteRule ^(.*)$ index.cfm/%{REQUEST_URI} [QSA,L,NS]
21+
RewriteRule ^(.*)$ index.cfm/%{REQUEST_URI} [PT,QSA,L,NS]
2222
```
2323
2424
{% hint style="warning" %}
25-
The above htaccess file might not work combined with Apache. Recent versions of Apache don't send the CGI.PATH\_INFO variable to your cfml engine when using ProxyPass and ProxyPassMatch. It that's the case you might need a [pathInfoProvider](../pathinfo-providers.md) function in your router.cfc
25+
Recent versions of Apache don't send the CGI.PATH\_INFO variable to your cfml engine when using ProxyPass and ProxyPassMatch without the `PT` ( Pass Through ) directive. On current versions of Coldbox, you can also use a [pathInfoProvider](../pathinfo-providers.md) function in your router.cfc
2626
{% endhint %}
2727
2828
The following solution might work better if you are using a recent version of Apache. This should be part of your `.htaccess` file
@@ -33,7 +33,7 @@ RewriteEngine On
3333
RewriteRule ^$ /index.cfm?redirect_path=/ [QSA,NS]
3434
RewriteCond %{REQUEST_FILENAME} !-f
3535
RewriteCond %{REQUEST_FILENAME} !-d
36-
RewriteRule ^(.*)$ /index.cfm?redirect_path=%{REQUEST_URI} [QSA,L,NS]
36+
RewriteRule ^(.*)$ /index.cfm?redirect_path=%{REQUEST_URI} [PT,QSA,L,NS]
3737
```
3838
3939
Now you can create a pathInfo provider function in your router.cfc which brings back your path info to the router:

0 commit comments

Comments
 (0)