Results 1 to 7 of 7

Hybrid View

  1. #1
    Join Date
    May 2007
    Location
    SW Florida
    Posts
    1,051
    Plugin Contributions
    2

    Idea or Suggestion FIXED: .htacess rewrite not working

    Thank You Thank You Thank You that works perfectly! If anyone is looking for this, here is the final code that workes perfectly.


    Code:
     
    RewriteEngine on
    # Index Redirect for /index.php with no parameters
    RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /index\.php\ HTTP/
    RewriteRule ^index\.php$ http://www.capecabinetdepot.com/? [R=301,L]
     
    # Index Redirect for /(index.php)?main_page=index(&cPath=<blank>) URL
    RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /(index\.php)?\?main_page=index(&cPath=)?\ HTTP/
    RewriteRule ^(index\.php)?$ http://www.capecabinetdepot.com/? [R=301,L]
     
    # Canonical Redirect non-blank, non-www and/or appended port number to www [EXCLUDE /admin requests]
    RewriteCond %{HTTP_HOST}   !^(www\.capecabinetdepot\.com)?$
    RewriteCond %{REQUEST_URI} !^/admin [NC]
    RewriteRule (.*) http://www.capecabinetdepot.com/$1 [R=301,L]
     
    #Error Page
    #ErrorDocument 403 /403.shtml
    ErrorDocument 404 /404.shtml
    #ErrorDocument 401 /401.shtml
    #ErrorDocument 400 /400.shtml
    #ErrorDocument 500 /500.shtml
    AddLanguage en .en # English
    Newest Site: ChargerPros - Stuff4Toys

  2. #2
    Join Date
    Mar 2010
    Location
    UK
    Posts
    445
    Plugin Contributions
    0

    Default Re: .htacess rewrite not working

    Glad you're all fixed up!

    This is server configuration code and it is very unforgiving of logic and/or coding errors.

    Test very carefully.

    Do make sure you change the name of your /admin folder and use that name in the code above. Do not tell anyone in the forum the real name of the admin folder.

 

 

Similar Threads

  1. How do I use htaccess to not rewrite a subdomain?
    By Danielle in forum General Questions
    Replies: 3
    Last Post: 15 Feb 2012, 05:04 AM
  2. Email with Link to a product : URL redirect, rewrite, .htacess?
    By dharma in forum Templates, Stylesheets, Page Layout
    Replies: 2
    Last Post: 3 May 2007, 10:50 PM

Posting Permissions

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