0

I'm stuck with IIS6 for a specific project and I am having difficulty using ISAPI_Rewrite. I use the symfony1 guide, installed ISAPI_Rewrite3 and I am trying to install a project as a subdirectory (using a virtual directory) within a website domain.

There is already a website live at mydomain.com and I want my project to be under mydomain.com/myproject (without the trailing web folder). So I created a virtual directory in IIS under mydomain.com, created the folder c:\myproject and added those lines in the global httpd.conf configuration file

  # Defend your computer from some worm attacks
  RewriteRule .*(?:global.asa|default\.ida|root\.exe|\.\.).* . [F,I,O]


  # we skip all files with .something except .html
  RewriteCond URL /myproject/.*\..+$
  RewriteCond URL (?!/myproject/.*\.html$).*
  RewriteRule /myproject/(.*) /myproject/$1 [L]


  # we keep the .php files unchanged
  RewriteRule /myproject/(.*\.php)(.*) /myproject/$1$2 [L]


  # finally we redirect to our front web controller
  RewriteRule /myproject/(.*) /myproject/app.php [L]

But everything results in a http 404 not found when pointing to mydomain.com/myproject. Anyone had any success installing sf2 with IIS6 and ISAPI_Rewrite?

Steven Rosato
  • 2,174
  • 1
  • 21
  • 32

1 Answers1

0

You have 2 rules starting with the same pattern "/myproject/(.*)", this might cause issues. Also some rules are excessive. Please try the following config:

# we skip all files with .something except .html
RewriteCond URL (?!/myproject/.*\.html).*
RewriteRule /myproject/.*\..+ $0 [I,L]

# finally we redirect to our front web controller
RewriteRule /myproject/.* /myproject/app.php [I,L]
TonyCool
  • 1,004
  • 1
  • 6
  • 5