Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    Regular Coder
    Join Date
    Jan 2012
    Location
    Slovakia
    Posts
    111
    Thanks
    9
    Thanked 0 Times in 0 Posts

    Redirect app.php/{whatever}/{whatever}

    Hi!

    I would like to redirect app.php/{whatever}/{whatever}/{or here whatever} to only domain.com/{whatever}

    So the point is delete the app.php from the url but not only redirect it to domain.com but also KEEP THE QUERY STRING.

    I tried:

    RewriteCond %{THE_REQUEST} ^.*/app.php
    RewriteRule ^(.*)app.php$ /$1 [R=301,L]

    But from the cond. you can see it match only ^.*/app.php

    So the url domain.com/app.php is redirected
    But domain.com/app.php/Home/ is not
    How can i modify it to match my needs?
    Thx!

  • #2
    Regular Coder
    Join Date
    Jan 2012
    Location
    Slovakia
    Posts
    111
    Thanks
    9
    Thanked 0 Times in 0 Posts
    I didnt find how to mark it solved or delete it ... so for future readers.. this is solution:


    RewriteCond %{THE_REQUEST} ^.*/app.php
    RewriteRule ^(.*)app.php/(.*)?$ /$2 [R=301,L]


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •