1

I was just implementing a member login form that worked fine until I tried to remove the index.php from the url with the following .htaccess file:

<IfModule mod_rewrite.c>
        RewriteEngine On
        RewriteBase /

        # Removes index.php from ExpressionEngine URLs
        RewriteCond %{THE_REQUEST} ^GET.*index\.php [NC]
        RewriteCond %{REQUEST_URI} !/system/.* [NC]
        RewriteRule (.*?)index\.php/*(.*) /$1$2 [R=301,NE,L]

        # Directs all EE web requests through the site index file
        RewriteCond %{REQUEST_FILENAME} !-f
        RewriteCond %{REQUEST_FILENAME} !-d
        RewriteRule ^(.*)$ /index.php/$1 [L]
</IfModule>

In the general configuration "Name of your site's index page" is blanked out.

This is the member login form:

{exp:member:login_form return="http://www.website.com/index.php/projects_client"}
                    <div class="formBox">
                        <h1>Log in</h1>
                        <a href="#" class="close">&times;</a>
                        <div class="field">
                            <span class="label"><label for="username">Username:</label></span>
                            <input type="username" maxlength="32" name="username" id="username" placeholder="Username" required>
                        </div> <!-- /.field -->
                        <div class="field">
                            <span class="label"><label for="password">Password:</label></span>
                            <input maxlength="32" type="password" name="password" id="password" placeholder="Password" required>
                        </div> <!-- /.field -->
                        <div class="buttons">
                            <button type="submit" class="button primary">Continue</button>
                            {if auto_login}
                            <div class="field cb">
                                <span class="label cb"><label><input type="checkbox" name="auto_login" value="1"> Remember me</label></span>
                            </div> <!-- /.field.cb -->
                            {/if}
                        </div> <!-- /.buttons -->
                    </div> <!-- /.formBox -->
                    <p><a href="{path='member/forgot_password'}">Forgot your <span>password</span>?</a></p>
                {/exp:member:login_form}

The return url is temporary, I wan't it to be something like this: redirect="projects_client"

When the index.php is removed and I submit the form I'm just redirected to the homepage. I'm not logged in. When I put the index.php back (Comment the .htaccess file and put index.php back in the general configuration: "Name of your site's index page") It's working again.

Does anybody know what's going on?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.