Go Back   CodingForums.com > :: Server side development > Apache configuration

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 07-11-2012, 07:10 PM   PM User | #1
JFM Jr
New to the CF scene

 
Join Date: Nov 2011
Posts: 7
Thanks: 2
Thanked 0 Times in 0 Posts
JFM Jr is an unknown quantity at this point
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.

Code:
#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


Thanks

Last edited by JFM Jr; 07-12-2012 at 04:52 PM..
JFM Jr is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 06:21 PM.


Advertisement
Log in to turn off these ads.