Forum Moderators: phranque
RewriteCond %{HTTP_HOST} ^jailnation.com [NC]
RewriteRule ^(.*)$ http://www.jailnation.com/$1 [L,R=301]
RewriteRule ^index.php$ http://www.jailnation.com/ [R=301,QSA]
RewriteRule blog/$ blog/index.php
RewriteRule cms/$ cms/index.php
#RewriteRule ^nh/$ jail_state.php?state_url=nvt
RewriteCond %{REQUEST_URI} !^blog
#RewriteRule ([^.php]*)/$ jail_state.php?state_url=$1%{QUERY_STRING}
RewriteCond %{REQUEST_URI} !^blog/wp-admin/
RewriteRule blog/wp-admin/$ blog/wp-admin/index.php
RewriteRule ^([^/]*)/([^/]*)/$ jail_description.php?state_url=$1&county_url=$2 [QSA]
RewriteRule ^CompanyProfile/([^/]*)$ company_details.php$1 [L]
RewriteRule ^Login$ login.php [L]
RewriteRule ^MyAccount$ company_details.php [L]
RewriteRule ^EditProfile$ edit_profile.php [L]
RewriteRule ^ChangePassword$ change_password.php [L]
RewriteRule ^Logout$ logout.php [L]
RewriteRule ^JailBailBondsListing$ jail_bailbonds_paid_listing.php [L]
RewriteRule ^JailAttorneyListing$ jail_attorney_paid_listing.php [L]
RewriteRule ^BrowseLegalFAQ$ browse_legal_faq.php [L]
RewriteRule ^HowToHelp$ how-to-help.php [L]
RewriteRule ^ContactUs$ contact_us.php [L]
RewriteRule ^OurMission$ our_mission.php [L]
RewriteRule ^SiteMap$ sitemap.php [L]
RewriteRule ^AdvertisingResorces$ advertising_resorces.php [L]
RewriteRule ^BrowseBailFAQ$ browse_bail_faq.php [L]
RewriteCond %{REQUEST_URI} !^login/
RewriteRule ^([^/]*)/$ jail_state.php?state_url=$1%{QUERY_STRING}
#ErrorDocument 404 http://jailnation.com/error/?do=error404
#ErrorDocument 404 /404.php
</IfModule>
[^.php]*) is a negative match character group. As such it does not match any request with a period in or which contains either a p or an h. ^([^/]*)/([^/]*)/$ allows a request for example.com/// to be valid. Use + not * here. RewriteRule blog/$ blog/index.php [L] and others can be served by using DirectoryIndex index.php RewriteCond %{REQUEST_URI} !^blog/wp-admin/
RewriteRule blog/wp-admin/$ blog/wp-admin/index.php [L] ([^.php]*)/$ does not do what you think it does and is incorrect. RewriteRule ^CompanyProfile/([^/]*)$ company_details.php$1 [L] ^([^/]+)/([^/]+)/$ pattern. example.com/CompanyProfile/SomeVar will be written to the internal filepath at /company_details.phpSomeVar which will obviously 404.
I am still having trouble when adding a random set of letters to a directory in the url it is creating the page and displaying it.