Advertisement
Help Keep Boards Alive. Support us by going ad free today. See here: https://subscriptions.boards.ie/.
If we do not hit our goal we will be forced to close the site.

Current status: https://keepboardsalive.com/

Annual subs are best for most impact. If you are still undecided on going Ad Free - you can also donate using the Paypal Donate option. All contribution helps. Thank you.
https://www.boards.ie/group/1878-subscribers-forum

Private Group for paid up members of Boards.ie. Join the club.

how do i do this with htaccess ?

Comments

  • Registered Users, Registered Users 2 Posts: 356 ✭✭fergalfrog


    I think this should probably be in development (rather than design)

    Your htaccess file should look like this:

    RewriteEngine On
    # Make it case insensitive
    RewriteRule ^rule$ ... [NC]
    RewriteRule ^(.*)@(.*)$ index.php?option=productquote&email=$1@$2

    I have tested it here and it works as expected - let me know how you go.


  • Registered Users, Registered Users 2 Posts: 648 ✭✭✭ChicoMendez


    hi there

    thanks for that !


    how would i tweak it though so as
    (notice the /d )

    www.domain.com/d/james@james.com

    is redirected to

    http://www.domain.com/index.php?option&email=james@james.com

    thanks alot !


  • Registered Users, Registered Users 2 Posts: 356 ✭✭fergalfrog


    Try this:

    RewriteEngine On
    # Make it case insensitive
    RewriteRule ^rule$ ... [NC]
    RewriteRule ^(.*)d/(.*)@(.*)$ index.php?option=productquote&email=$2@$3


  • Registered Users, Registered Users 2 Posts: 648 ✭✭✭ChicoMendez


    hi,

    does not seem to be working - would it have anything to do with the stuff that was already in the htaccess file
    DirectoryIndex index.php
    RewriteEngine On
    RewriteBase /
    
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond %{REQUEST_URI} !^/index.php
    RewriteCond %{REQUEST_URI} (/|\.php|\.html|\.htm|\.feed|\.pdf|\.raw|/[^.]*)$  [NC]
    RewriteRule (.*) index.php
    RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization},L]
    
    
    
    
    ########## Begin - Rewrite rules to block out some common exploits
    ## If you experience problems on your site block out the operations listed below
    ## This attempts to block the most common type of exploit `attempts` to Joomla! 
    #                              
    # Block out any script trying to set a mosConfig value through the URL
    RewriteCond %{QUERY_STRING} mosConfig_[a-zA-Z_]{1,21}(=|\%3D) [OR]
    # Block out any script trying to base64_encode crap to send via URL
    RewriteCond %{QUERY_STRING} base64_encode.*\(.*\) [OR]
    # Block out any script that includes a <script> tag in URL
    RewriteCond %{QUERY_STRING} (\<|%3C).*script.*(\>|%3E) [NC,OR]
    # Block out any script trying to set a PHP GLOBALS variable via URL
    RewriteCond %{QUERY_STRING} GLOBALS(=|\[|\%[0-9A-Z]{0,2}) [OR]
    # Block out any script trying to modify a _REQUEST variable via URL
    RewriteCond %{QUERY_STRING} _REQUEST(=|\[|\%[0-9A-Z]{0,2})
    # Send all blocked request to homepage with 403 Forbidden error!
    RewriteRule ^(.*)$ index.php [F,L]
    # 
    ########## End - Rewrite rules to block out some common exploits
    


  • Registered Users, Registered Users 2 Posts: 356 ✭✭fergalfrog


    I tested it and it works fine here so yes it may be as a result of the other rewrite rules.

    You may want to clear out the htaccess file and start adding lines back in to find out which line is conflicting.


  • Advertisement
Advertisement