Forum

Thread tagged as: Addons, Members

Members app and URL rewriting

Hi,

I am using the code below to rewrite URL's as per https://docs.grabaperch.com/video/v/simple-url-rewriting/

# Redirect to PHP if it exists.
    # e.g. example.com/foo will display the contents of example.com/foo.php
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond %{REQUEST_FILENAME}.php -f 
    RewriteRule ^(.+)$ $1.php [L,QSA]

I have a members area on the site that uses the members app.

The logout link has stopped working since i added the above the the .htaccess file. When you click logout it takes you to /clients/logout but the logout and redirection below are not working:

<?php 
    include('../admin/runtime.php');
    perch_member_log_out(); 
    PerchUtil::redirect('/clients/');

Any ideas how I can modify the code to fix this?

Andy Knight

Andy Knight 1 points

  • 6 years ago
Drew McLellan

Drew McLellan 2638 points
Perch Support

What's the URL of your logout page?

Hi Drew,

/clients/logout.php

Drew McLellan

Drew McLellan 2638 points
Perch Support

It looks like it should work. When you say it's not working, what happens exactly?

Hi Drew,

The reason it wasn't working was that I had changed the logout URL from /clients/logout.php to /clients/logout This works if I change back to /clients/logout.php

Drew McLellan

Drew McLellan 2638 points
Perch Support

Yes, but what happens?

When you click logout it takes you to /clients/logout which is a basic page with header and footer but no content. You are not logged out (so you can still see the clients data) or returned to the /clients page

Drew McLellan

Drew McLellan 2638 points
Perch Support

Are you sure that's your logout.php page? If so, how would it get all that markup when it only contains the above 3 lines?