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 3 of 3
  1. #1
    New Coder
    Join Date
    Mar 2012
    Posts
    14
    Thanks
    2
    Thanked 0 Times in 0 Posts

    Can't figure out this .htaccess thing. . .

    If anyone could please help it would be appreciated.

    I need to create a permanent 301 redirect from

    index.php and have it go to index.php?do=accessories

    Can anyone help me? I would need the full example of what the .htaccess file would look like.

    Thanks in advance to anyone who can help!

  • #2
    New Coder
    Join Date
    Mar 2012
    Posts
    14
    Thanks
    2
    Thanked 0 Times in 0 Posts
    I thought I would go ahead and show everyone what I'm trying to do, and maybe that will help.

    My current .htaccess file that is in there, that I didn't create, read as follows:

    Code:
    RewriteEngine off
    
    #RewriteCond %{HTTP_HOST} ^shop.parasailmyrtlebeach.com$ [OR]
    #RewriteCond %{HTTP_HOST} ^www.shop.parasailmyrtlebeach.com$
    #RewriteRule ^/?$ "http\:\/\/127\.0\.0\.1\:12002%{REQUEST_URI}" [P,QSA,L]
    
    DirectoryIndex index.html index.htm index.php
    What I thought would fix what I need is the following:

    Code:
    ##  Can be commented out if causes errors, see notes above.
    # Options +FollowSymLinks
    
    #
    #  mod_rewrite in use
    
    RewriteEngine On
    RewriteCond %{HTTP_HOST} !^www\.
    RewriteRule ^(.*)$ http://www.%{HTTP_HOST}/$1 [R=301,L]
    Redirect 301 /index.php index.php?do=accessories
    
    DirectoryIndex index.html index.htm index.php
    But when I create that second .htaccess file, I just get a 404 error.

    Hopefully this helps with someone troubleshooting

  • #3
    New Coder
    Join Date
    Mar 2012
    Posts
    14
    Thanks
    2
    Thanked 0 Times in 0 Posts
    Nevermind, I just did a php redirect instead.


  •  

    Posting Permissions

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