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

Thread: htaccess help

  1. #1
    New Coder
    Join Date
    Oct 2007
    Location
    In front of PC
    Posts
    96
    Thanks
    25
    Thanked 3 Times in 3 Posts

    htaccess help

    I would like to redirect

    http://localhost/wordpress/register/
    to
    http://localhost/wordpress/register/?action=new

    but the rule should not affect the url if it has query string.
    e.g.
    http://localhost/wordpress/register/?action=check shouldn't be redirected.

    how to get this redirect??
    Learning never ends....

  • #2
    God Emperor Fou-Lu's Avatar
    Join Date
    Sep 2002
    Location
    Saskatoon, Saskatchewan
    Posts
    16,980
    Thanks
    4
    Thanked 2,659 Times in 2,628 Posts
    Hopefully you're checking in.
    Try this:
    Code:
    RewriteEngine On
    Rewrite Rule ^wordpress/register$ wordpress/register/?action=new [L]
    You're better off re-writing you're PHP code though, since this is apache exclusive.
    To do it, you'd simply add something like so to you're wordpress/register/index.php page:
    PHP Code:

    if (!isset($_GET['action']))
    {
        
    $_GET['action'] = 'new';

    PHP Code:
    header('HTTP/1.1 420 Enhance Your Calm'); 


  •  

    Posting Permissions

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