Welcome Guest, Not a member yet? Register   Sign In
.htaccess in a subfolder routes everything to standard route
#1

[eluser]Fabdrol[/eluser]
Hi people,

I've got a little problem with my htaccess. It's in a subfolder, which contains the index.php file of one of the applications on the server.
Structure:
Code:
- / (root)
- /framework/
    - ...
- /applications/
    - dynamics/
    - api/
    - interface/
- /httpdocs/
    - index.php
    - .htaccess
    - dynamics/index.php
    - dynamics/.htaccess
    - api/index.php
    - api/.htaccess

My htaccess file (with a little help from the wiki):
Code:
<IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /dynamics/

    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule ^(.*)$ index.php?/$1 [L]
</IfModule>

<IfModule !mod_rewrite.c>
    ErrorDocument 404 /index.php
</IfModule>

somehow, this code just rewrites every request to dynamics/index.php. Everything after index.php gets routed to index.php, without anything after it.
so, a url index.php/payment/success rewrites to index.php, which it shouldn't.
Strange thing is, this htaccess works in the root, but aparently not in the subfolder, somehow

Any thoughts?

thanks!
#2

[eluser]WanWizard[/eluser]
Get rid of the ? in the RewriteRule:
Code:
RewriteRule ^(.*)$ index.php/$1 [L]
#3

[eluser]Fabdrol[/eluser]
Thanks! That did it!




Theme © iAndrew 2016 - Forum software by © MyBB