Welcome Guest, Not a member yet? Register   Sign In
8 simple 301 redirects not working
#4

[eluser]skunkbad[/eluser]
[quote author="charlie spider" date="1275394098"]Thanks for the help but I think you misinterpreted by post.

I'm not trying to redirect a url with a query string.

I need:

(old url) www.coachhouse.info/rates.htm

to redirect to:

(new url) http://www.coachhouse.info/rates-and-info

no query strings. The original site was all static html pages with no PHP anywhere to be found.[/quote]

Well, in that case, you are also in luck, because I did something similar to my site a while back, where I removed the file endings. You should be able to work with this:

Code:
# Turn on URL rewriting
RewriteEngine On

# Installation directory
RewriteBase /

# Block Java Bots
RewriteCond %{HTTP_USER_AGENT} ^Java.*
RewriteRule .* - [F,L]

RewriteCond %{HTTP_HOST} !^skunkbad\.com$ [NC]
RewriteCond %{HTTPS} !=on
RewriteRule ^(.*)$ http://skunkbad.com/$1 [L,R=301]

# Protect application and system files from being viewed
RewriteRule ^(system|application) - [F,L]

# Allow any files or directories that exist to be displayed directly
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !^portfolio.php [NC]
RewriteCond %{REQUEST_FILENAME} !^development.php [NC]
RewriteCond %{REQUEST_FILENAME} !^about.php [NC]
RewriteCond %{REQUEST_FILENAME} !^faq.php [NC]
RewriteCond %{REQUEST_FILENAME} !^contact.php [NC]
RewriteCond %{REQUEST_FILENAME} !^estimates.php [NC]
RewriteCond %{REQUEST_FILENAME} !^templates.php [NC]
RewriteCond %{REQUEST_FILENAME} !^accessibility.php [NC]
RewriteCond %{REQUEST_FILENAME} !^privacy.php [NC]
RewriteCond %{REQUEST_FILENAME} !^terms.php [NC]
RewriteCond %{REQUEST_FILENAME} !^sitemap.php [NC]

# Rewrite all other URLs to index.php/URL
RewriteRule .* index.php/$0 [PT,L]

RewriteRule /portfolio.php http://skunkbad.com/portfolio [R=301,L]
RewriteRule /development.php http://skunkbad.com/development [R=301,L]
RewriteRule /about.php http://skunkbad.com/about [R=301,L]
RewriteRule /faq.php http://skunkbad.com/faq [R=301,L]
RewriteRule /contact.php http://skunkbad.com/contact [R=301,L]
RewriteRule /estimates.php http://skunkbad.com/estimates [R=301,L]
RewriteRule /templates.php http://skunkbad.com/templates [R=301,L]
RewriteRule /accessibility.php http://skunkbad.com/accessibility [R=301,L]
RewriteRule /privacy.php http://skunkbad.com/privacy [R=301,L]
RewriteRule /terms.php http://skunkbad.com/terms [R=301,L]
RewriteRule /sitemap.php http://skunkbad.com/sitemap [R=301,L]

Options -Indexes

php_value date.timezone "America/Los_Angeles"


Messages In This Thread
8 simple 301 redirects not working - by El Forum - 06-01-2010, 12:29 AM
8 simple 301 redirects not working - by El Forum - 06-01-2010, 12:51 AM
8 simple 301 redirects not working - by El Forum - 06-01-2010, 01:08 AM
8 simple 301 redirects not working - by El Forum - 06-01-2010, 01:16 AM
8 simple 301 redirects not working - by El Forum - 06-01-2010, 02:01 AM
8 simple 301 redirects not working - by El Forum - 06-01-2010, 12:21 PM
8 simple 301 redirects not working - by El Forum - 06-01-2010, 12:56 PM
8 simple 301 redirects not working - by El Forum - 06-01-2010, 12:59 PM
8 simple 301 redirects not working - by El Forum - 06-01-2010, 01:25 PM
8 simple 301 redirects not working - by El Forum - 06-01-2010, 01:35 PM
8 simple 301 redirects not working - by El Forum - 06-01-2010, 01:53 PM
8 simple 301 redirects not working - by El Forum - 06-01-2010, 02:16 PM
8 simple 301 redirects not working - by El Forum - 06-01-2010, 02:51 PM
8 simple 301 redirects not working - by El Forum - 06-01-2010, 04:42 PM
8 simple 301 redirects not working - by El Forum - 06-01-2010, 09:53 PM
8 simple 301 redirects not working - by El Forum - 06-02-2010, 06:19 AM



Theme © iAndrew 2016 - Forum software by © MyBB