Active TopicsActive Topics  Display List of Forum MembersMemberlist  HelpHelp   RegisterRegister  LoginLogin
Common Questions
 Helicon Tech : Common Questions
Subject Topic: ISAPI_REWRITE Lite and Symfony Post ReplyPost New Topic
Author
Message << Prev Topic | Next Topic >>
souldivide
Newbie
Newbie


Joined: 16 October 2007
Location: Philippines
Online Status: Offline
Posts: 2
Posted: 16 October 2007 at 10:47am | IP Logged Quote souldivide

Greetings,

I'm using Symfony PHP framework right now with the website I'm working on and I need to get clean URL. Is it possible with Rewrite Lite? My URL always need to include the php file name in the url which makes it look a little messy.

I am hoping to get http://localhost/module/action/parameter instead of http://localhost/filename.php/module/action/parameter.

Any advice would be greatly appreciated.

Thank you.
Back to Top View souldivide's Profile Search for other posts by souldivide
 
Lexey
Moderator Group
Moderator Group


Joined: 15 August 2002
Location: Russian Federation
Online Status: Offline
Posts: 7373
Posted: 19 October 2007 at 11:58am | IP Logged Quote Lexey

ISAPI_Rewrite could allow you to access http://localhost/filename.php/module/action/parameter as http://localhost/module/action/parameter. But you will need to modify your application to present new link (http://localhost/module/action/parameter) to a user instead of an old one.
Back to Top View Lexey's Profile Search for other posts by Lexey
 
souldivide
Newbie
Newbie


Joined: 16 October 2007
Location: Philippines
Online Status: Offline
Posts: 2
Posted: 19 October 2007 at 12:55pm | IP Logged Quote souldivide

Thanks for the response.

When you say that I need to modify my application, do you mean Symfony? Symfony has a packaged .htaccess that contains the rewriting rules which I know IIS does not recognize. Or is it the httpd.ini found in the installation directory of isapi_rewrite? right now, the code found in my httpd.ini is:


[ISAPI_Rewrite]

# 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 .*\..+$
RewriteCond URL (?!.*\.html$).*
RewriteRule (.*) $1 [L]


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


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


This is what it contains but sadly, the routing is not working. If i use http://localhost/not_index.php/module/action/parameter it will work but if I use http://localhost/index.php/module/action/parameter it wont. i think it is because index.php is set as the default home page which is why its being ommitted in the url.

I need to know if what I need to do is work on the isapi_rewrite side or on the symfony side to make this going. I hope someone can point me to the correct direction.

thank you.

Back to Top View souldivide's Profile Search for other posts by souldivide
 
Lexey
Moderator Group
Moderator Group


Joined: 15 August 2002
Location: Russian Federation
Online Status: Offline
Posts: 7373
Posted: 21 October 2007 at 7:29am | IP Logged Quote Lexey

If Symfony already has predefined .htaccess file then you'd better to try to use it as is with the ISAPI_Rewrite 3. ISAPI_Rewrite 2 has different syntax, so .htaccess rules will not work without modifications.
Back to Top View Lexey's Profile Search for other posts by Lexey
 

If you wish to post a reply to this topic you must first login
If you are not already registered you must first register

  Post ReplyPost New Topic
Printable version Printable version

Forum Jump
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot delete your posts in this forum
You cannot edit your posts in this forum
You cannot create polls in this forum
You cannot vote in polls in this forum