| Author |
|
tvdh Newbie

Joined: 02 August 2011 Location: Netherlands
Online Status: Offline Posts: 7
|
| Posted: 02 August 2011 at 9:13am | IP Logged
|
|
|
Hello,
I have am planning to update my server from isapi rewrite to ape. I have installed the trial version of ape.
There is a problem with a htaccess file, in isapi rewrite it works perfect, but with ape i get an error.
This is the part were it goes wrong:
RewriteEngine On RewriteBase / ## If it's not a request for a real file. RewriteCond %{SCRIPT_FILENAME} !-f ## Add the trailing slash. I removed the L flag because I want to process the next rule, <Files myscript>, but it's not actually a mod_rewrite rule so maybe I can leave it in. RewriteRule [^/]$ %{REQUEST_URI}/ [R=301] RewriteCond %{SCRIPT_FILENAME} !-f RewriteRule ^(.*)$ $1/index.cfm
I get the following error ( i have changed my sitename):
(4) ape_module: 'http:/bla.testserver.bla.nl/test//index.cfm' is not a valid virtual path.
When i remove a / i still get the same error.
When i remove [R=301] it works perfect, but my site isnt working right then.
Can someone help me?
|
| Back to Top |
|
| |
Vyacheslav Admin Group

Joined: 02 July 2008 Location: Ukraine
Online Status: Offline Posts: 1542
|
| Posted: 03 August 2011 at 9:27am | IP Logged
|
|
|
Hello.
Well, first you add trailing slash to any non-existent file (REQUEST_FILENAME is better by the way), then you forward that request to $1/index.cfm which expands into http:/bla.testserver.bla.nl/test//index.cfm
Could you please clarify the general purpose of the rules.
Thank you.
__________________ Slavik Shynkarenko,
Helicon Tech.
|
| Back to Top |
|
| |
tvdh Newbie

Joined: 02 August 2011 Location: Netherlands
Online Status: Offline Posts: 7
|
| Posted: 05 August 2011 at 7:30am | IP Logged
|
|
|
These rules are used to place /index.cfm behind a url when a file or folder doesnt exist..
|
| Back to Top |
|
| |
Vyacheslav Admin Group

Joined: 02 July 2008 Location: Ukraine
Online Status: Offline Posts: 1542
|
| Posted: 08 August 2011 at 7:36am | IP Logged
|
|
|
Hello.
Please try the following example:
Code:
RewriteEngine on
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.+?)/?$ $1/index.cfm [R=301,L] |
|
|
__________________ Slavik Shynkarenko,
Helicon Tech.
|
| Back to Top |
|
| |
tvdh Newbie

Joined: 02 August 2011 Location: Netherlands
Online Status: Offline Posts: 7
|
| Posted: 19 August 2011 at 4:07am | IP Logged
|
|
|
When i try the example in ISAPI rewrite the browser tells me that the page i am visiting returns in a neverending loop.
The url is like this http://url/index.cfm/index.cfm/index.cfm/index.cfm/index.cfm/index.cfm/index.cfm/index.cfm/index.cfm/index.cfm/index.cfm/index.cfm
Do you know what is wrong?
|
| Back to Top |
|
| |
Vyacheslav Admin Group

Joined: 02 July 2008 Location: Ukraine
Online Status: Offline Posts: 1542
|
| Posted: 22 August 2011 at 4:41am | IP Logged
|
|
|
Hello.
Please try this:
Code:
RewriteEngine on
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(?!index\.cfm)(.+?)/?$ $1/index.cfm [NC,R=301,L] |
|
|
__________________ Slavik Shynkarenko,
Helicon Tech.
|
| Back to Top |
|
| |
tvdh Newbie

Joined: 02 August 2011 Location: Netherlands
Online Status: Offline Posts: 7
|
| Posted: 23 August 2011 at 3:33am | IP Logged
|
|
|
With this code I still have the same problem.
|
| Back to Top |
|
| |
Vyacheslav Admin Group

Joined: 02 July 2008 Location: Ukraine
Online Status: Offline Posts: 1542
|
| Posted: 26 August 2011 at 7:34am | IP Logged
|
|
|
Hello.
Could you please provide rewrite.log records.
Thank you.
__________________ Slavik Shynkarenko,
Helicon Tech.
|
| Back to Top |
|
| |
tvdh Newbie

Joined: 02 August 2011 Location: Netherlands
Online Status: Offline Posts: 7
|
| Posted: 08 September 2011 at 8:21am | IP Logged
|
|
|
This is the log:
Code:
95.97.101.6 95.97.101.6 Thu, 08-Sep-2011 15:18:38 GMT [keistoer.testserver.keistoer.nl/sid#36900604][rid#60581544/initial] (2) init rewrite engine with requested uri /over-keistoer//index.cfm/index.cfm/index.cfm/index.cfm/index.cfm/index.cfm/index.cfm/index.cfm/index.cfm/index.cfm/index.cfm/index.cfm/index.cfm/index.cfm/index.cfm/index.cfm/index.cfm/index.cfm/index.cfm/index.cfm 95.97.101.6 95.97.101.6 Thu, 08-Sep-2011 15:18:38 GMT [keistoer.testserver.keistoer.nl/sid#36900604][rid#60581544/initial] (1) Htaccess process request C:\Program Files\Helicon\ISAPI_Rewrite3\httpd.conf 95.97.101.6 95.97.101.6 Thu, 08-Sep-2011 15:18:38 GMT [keistoer.testserver.keistoer.nl/sid#36900604][rid#60581544/initial] (1) Htaccess process request d:\webdata\wwwroot\insite3\sites\k\keistoer\www\.htaccess 95.97.101.6 95.97.101.6 Thu, 08-Sep-2011 15:18:38 GMT [keistoer.testserver.keistoer.nl/sid#36900604][rid#60581544/initial] (3) applying pattern '^(?!index\.cfm)(.+?)/?$' to uri 'over-keistoer//index.cfm/index.cfm/index.cfm/index.cfm/index.cfm/index.cfm/index.cfm/index.cfm/index.cfm/index.cfm/index.cfm/index.cfm/index.cfm/index.cfm/index.cfm/index.cfm/index.cfm/index.cfm/index.cfm/index.cfm' 95.97.101.6 95.97.101.6 Thu, 08-Sep-2011 15:18:38 GMT [keistoer.testserver.keistoer.nl/sid#36900604][rid#60581544/initial] (4) RewriteCond: input='//?/D:/WEBData/wwwroot/InSite3/sites/k/keistoer/www/over-keistoer/index.cfm' pattern='!-f' => matched 95.97.101.6 95.97.101.6 Thu, 08-Sep-2011 15:18:38 GMT [keistoer.testserver.keistoer.nl/sid#36900604][rid#60581544/initial] (4) RewriteCond: input='//?/D:/WEBData/wwwroot/InSite3/sites/k/keistoer/www/over-keistoer/index.cfm' pattern='!-d' => matched 95.97.101.6 95.97.101.6 Thu, 08-Sep-2011 15:18:38 GMT [keistoer.testserver.keistoer.nl/sid#36900604][rid#60581544/initial] (1) escaping /over-keistoer//index.cfm/index.cfm/index.cfm/index.cfm/index.cfm/index.cfm/index.cfm/index.cfm/index.cfm/index.cfm/index.cfm/index.cfm/index.cfm/index.cfm/index.cfm/index.cfm/index.cfm/index.cfm/index.cfm/index.cfm/index.cfm 95.97.101.6 95.97.101.6 Thu, 08-Sep-2011 15:18:38 GMT [keistoer.testserver.keistoer.nl/sid#36900604][rid#60581544/initial] (2) explicitly forcing redirect with http://keistoer.testserver.keistoer.nl/over-keistoer//index.cfm/index.cfm/index.cfm/index.cfm/index.cfm/index.cfm/index.cfm/index.cfm/index.cfm/index.cfm/index.cfm/index.cfm/index.cfm/index.cfm/index.cfm/index.cfm/index.cfm/index.cfm/index.cfm/index.cfm/index.cfm 95.97.101.6 95.97.101.6 Thu, 08-Sep-2011 15:18:38 GMT [keistoer.testserver.keistoer.nl/sid#36900604][rid#60581544/initial] (2) internal redirect with /over-keistoer//index.cfm/index.cfm/index.cfm/index.cfm/index.cfm/index.cfm/index.cfm/index.cfm/index.cfm/index.cfm/index.cfm/index.cfm/index.cfm/index.cfm/index.cfm/index.cfm/index.cfm/index.cfm/index.cfm/index.cfm [INTERNAL REDIRECT]
|
|
|
|
| Back to Top |
|
| |
Vyacheslav Admin Group

Joined: 02 July 2008 Location: Ukraine
Online Status: Offline Posts: 1542
|
| Posted: 12 September 2011 at 4:53am | IP Logged
|
|
|
Hello.
Please try this:
Code:
RewriteEngine on
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} !^/[^/]+/index\.cfm$ [NC]
RewriteRule ^([^.?]+[^.?/])$ $1/index.cfm[NC,R=301,L] |
|
|
__________________ Slavik Shynkarenko,
Helicon Tech.
|
| Back to Top |
|
| |
tvdh Newbie

Joined: 02 August 2011 Location: Netherlands
Online Status: Offline Posts: 7
|
| Posted: 12 September 2011 at 6:13am | IP Logged
|
|
|
I think it is working now!
The only thing wrong is,
before the links were visible as: site.com/test Now it is visible as: site.com/test/iindex.cfm
Do you know how i can solve this?
Thanks in advance
Edited by tvdh - 12 September 2011 at 6:21am
|
| Back to Top |
|
| |
Vyacheslav Admin Group

Joined: 02 July 2008 Location: Ukraine
Online Status: Offline Posts: 1542
|
| Posted: 12 September 2011 at 8:13am | IP Logged
|
|
|
That’s what the rules do. When you add R=301 it redirects. What result would you like to see? Please explain with examples.
Thank you.
__________________ Slavik Shynkarenko,
Helicon Tech.
|
| Back to Top |
|
| |
tvdh Newbie

Joined: 02 August 2011 Location: Netherlands
Online Status: Offline Posts: 7
|
| Posted: 28 September 2011 at 4:13am | IP Logged
|
|
|
Hello,
We have tested the rule further. It is working when the url that is called is like:
http://site.com/blabla
But not when it is:
http://site.com/blabla/
Do you have a solution for that?
|
| Back to Top |
|
| |
Vyacheslav Admin Group

Joined: 02 July 2008 Location: Ukraine
Online Status: Offline Posts: 1542
|
| Posted: 03 October 2011 at 4:56am | IP Logged
|
|
|
Hello.
Please try the following code:
Code:
RewriteEngine on
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} !^/[^/]+/index\.cfm$ [NC]
RewriteRule ^(.+)$ $1/index.cfm [NC,R=301,L] |
|
|
__________________ Slavik Shynkarenko,
Helicon Tech.
|
| Back to Top |
|
| |