Membership errors when using redirects

6 posts by 2 authors in: Forums > CMS Builder: Plugins & Add-ons
Last Post: June 9, 2010   (RSS)

By (Deleted User) - June 5, 2010

Hello,

I have a blog detail page using the page /blog-entry.php
All blogs use custom keywords in the url followed by the blogs num

For example, the original url would be:
/blog-entry.php?healthy-living-4

For SEO benefits I have the following htaccess rewrite:

Options +FollowSymLinks
Options +Indexes
RewriteEngine on
RewriteRule ^blogs/([^\.]+)$ blog-entry.php?id=$1 [NC,L]


this then allows the following url to see the blog:

/blogs/healthy-living-4

This works great and I have seen a significant increase in seo benefits because of this.
However now I would like to use the membership plugin and I am coming up against a small problem. Logs in as expected but when I want to log OUT it doesn't work - I have tried it on the original full url and it works so it's my rewrite that is doing it!

Here is the code for the log out link:

<?php if ($CURRENT_USER): ?>
<li id="logoff_link"><a href='?action=logoff'>Logoff</a></li>
<?php else: ?>
<li id="login_link"><a href="#login_wrapper">Login</a></li>
<?php endif ?>


Any ideas?

Thanks Jono

Re: [jonoc73] Membership errors when using redirects

By Jason - June 7, 2010

Hi Jono,

Since your rewrite is only for blog-entry.php, why not have a separate file that is just for logging off, like "log_off.php" You just have the "viewer_functions.php" at the top of the page, you can change your link to this:

<?php if ($CURRENT_USER): ?>
<li id="logoff_link"><a href='log_off.php?action=logoff'>Logoff</a></li>
<?php else: ?>
<li id="login_link"><a href="#login_wrapper">Login</a></li>
<?php endif ?>


That way it shouldn't interfere with your rewrite. Give this a try and let me know if you run into any other issues.

Hope this helps.
---------------------------------------------------
Jason Sauchuk - Project Manager
interactivetools.com

Hire me! Save time by getting our experts to help with your project.
http://www.interactivetools.com/consulting/

Re: [Jason] Membership errors when using redirects

By (Deleted User) - June 8, 2010

Jason.

All the other pages on the site will allow the visitor to log off and stay on the same page. Is there a way I can code it so that if they log off a rewritten page like the blogs page to go back to the page it was on - but as logged off?

I am planning to have rewrites on a number of other pages and it could get messy.

Thanks Jono

Re: [jonoc73] Membership errors when using redirects

By Jason - June 8, 2010

Hi,

If you could email your CMS login and FTP details to jason@interactivetools.com, I can take a look at see what other options may work.

Please don't post these details to the forum.

Thanks.
---------------------------------------------------
Jason Sauchuk - Project Manager
interactivetools.com

Hire me! Save time by getting our experts to help with your project.
http://www.interactivetools.com/consulting/

Re: [jonoc73] Membership errors when using redirects

By Jason - June 9, 2010

Hi,

The issue was that with the rewritten url, our logoff link looked like this:

http://www........../blogs/blog-one-1?action=logoff

which wouldn't work correctly. What I did was created a script in a page called logoff.php. All it does is handle the logoff, then immediately redirect the user back to the page they were at previously.

I also changed the include file "nav-top.php" so that the logoff link always points to that file.

Hope this helps.
---------------------------------------------------
Jason Sauchuk - Project Manager
interactivetools.com

Hire me! Save time by getting our experts to help with your project.
http://www.interactivetools.com/consulting/