Hello and welcome to our community! Is this your first visit?
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 1 of 1
  1. #1
    New to the CF scene
    Join Date
    Nov 2011
    Thanked 0 Times in 0 Posts

    htaccess RewriteRule not working - Solved

    I recently found out that this does work for more than one page but I NEED to put in a "/" at the end (ex: website/consultation/. Not website/consultation) For some reason, i do not need the "/" for the contact page. a little odd i think.

    #Redirect for nonexistant URLs
    ErrorDocument 404 /404.html
    #Redirect for Forbidden Pages
    ErrorDocument 403 /403.html
    #Eliminates the use of www.
    RewriteEngine On
    RewriteCond %{HTTP_HOST} ^www\.(.*)$ [NC]
    RewriteRule ^(.*)$ http://%1/$1 [R=301,L]
    Options All -Indexes
    #Makes contact page wm-cpa.com/contact
    RewriteEngine On
    RewriteRule ^contact/$        /contact/faq.html [L]
    RewriteRule ^consultation/$   /contact/consultation.html [L]
    #Does not require .html after urls
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond %{REQUEST_FILENAME}\.html -f
    RewriteRule .* $0.html

    Last edited by JFM Jr; 07-12-2012 at 05:52 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