2 replies
Is this code correct? Or am I mistaken?

# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
#RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{HTTP_HOST} ^test.countrytonitepf.com$
RewriteRule . /index.php [L]

RewriteRule default.asp / [R=301,L]
RewriteRule groups.aspx /groups/ [R=301,L]
RewriteRule about.aspx /about-the-show/ [R=301,L]
RewriteRule contact.aspx /contact-us/ [R=301,L]
RewriteRule tickets.aspx /buy-tickets-2/ [R=301,L]
RewriteRule gallery.aspx /photo-gallery/ [R=301,L]
RewriteRule awards.aspx /awards/ [R=301,L]
RewriteRule schedule.aspx /show-schedule/ [R=301,L]
RewriteRule christmas.aspx /christmas-show/ [R=301,L]
RewriteRule celebrities.aspx /celebrity-shows/ [R=301,L]
RewriteRule patty-waszak.aspxp /the-patty-waskaz-show/ [R=301,L]
RewriteRule student-groups.aspx /student-groups/ [R=301,L]
RewriteRule group-tickets.aspx /group-reservations/ [R=301,L]
RewriteRule escorts.aspx /escort-info/ [R=301,L]
RewriteRule group-reservations.aspx /group-reservations/ [R=301,L]
RewriteRule buy-now.aspx /buy-tickets-2/ [R=301,L]
RewriteRule our-cast.aspx /meet-our-cast/ [R=301,L]
RewriteRule area-links.aspx /area-links/ [R=301,L]
RewriteRule location.aspxp /location/ [R=301,L]
RewriteRule history.aspx /history/ [R=301,L]
RewriteRule auditions.aspx /auditions/ [R=301,L]
RewriteRule shows.aspx /the-show/ [R=301,L]
RewriteRule videos.aspx /photo-gallery/ [R=301,L]
RewriteRule our-cast.aspx /meet-our-cast/ [R=301,L]
RewriteRule area-links.aspx /area-links/ [R=301,L]
</IfModule>
# END WordPress


The only Rule working here is the one for defailt.asp... Does anyone know why?
Im not that familiar with apache syntax for .hta files so maybe I went wrong there...
#apache #awry #htaccess
  • Profile picture of the author SteveJohnson
    The default.asp rule isn't working either. Just seems like it is. The server is probably set up to see 'default.asp' as an index page for the folder, so does its own redirect.

    Rewrite rules are sequential. Apache will execute the first that matches. It isn't even getting to your list.

    Move your rules to just after the RewriteBase directive.

    Better still, move them out of the WP <IfModule> block completely; they may get overwritten when you regenerate WP permalinks.
    Signature

    The 2nd Amendment, 1789 - The Original Homeland Security.

    Gun control means never having to say, "I missed you."

    {{ DiscussionBoard.errors[8563103].message }}
    • Profile picture of the author PHPSpaZ
      Thank you! That was the correct answer! It is now:

      # BEGIN WordPress
      <IfModule mod_rewrite.c>
      RewriteEngine On
      RewriteBase /
      RewriteRule ^index\.php$ - [L]
      RewriteRule ^default.asp$ / [R=301,L]
      RewriteRule ^groups.aspx$ http://test.countrytonite.com/groups/ [R=301,L]
      RewriteRule ^about.aspx$ /about-the-show/ [R=301,L]
      RewriteRule ^contact.aspx$ /contact-us/ [R=301,L]
      RewriteRule ^tickets.aspx$ /buy-tickets-2/ [R=301,L]
      RewriteRule ^gallery.aspx$ /photo-gallery/ [R=301,L]
      RewriteRule ^awards.aspx$ /awards/ [R=301,L]
      RewriteRule ^schedule.aspx$ /show-schedule/ [R=301,L]
      RewriteRule ^christmas.aspx$ /christmas-show/ [R=301,L]
      RewriteRule ^celebrities.aspx$ /celebrity-shows/ [R=301,L]
      RewriteRule ^patty-waszak.aspxp$ /the-patty-waskaz-show/ [R=301,L]
      RewriteRule ^student-groups.aspx$ /student-groups/ [R=301,L]
      RewriteRule ^group-tickets.aspx$ /group-reservations/ [R=301,L]
      RewriteRule ^escorts.aspx$ /escort-info/ [R=301,L]
      RewriteRule ^group-reservations.aspx$ /group-reservations/ [R=301,L]
      RewriteRule ^buy-now.aspx$ /buy-tickets-2/ [R=301,L]
      RewriteRule ^our-cast.aspx$ /meet-our-cast/ [R=301,L]
      RewriteRule ^area-links.aspx$ /area-links/ [R=301,L]
      RewriteRule ^location.aspxp$ /location/ [R=301,L]
      RewriteRule ^history.aspx$ /history/ [R=301,L]
      RewriteRule ^auditions.aspx$ /auditions/ [R=301,L]
      RewriteRule ^shows.aspx$ /the-show/ [R=301,L]
      RewriteRule ^videos.aspx$ /photo-gallery/ [R=301,L]
      RewriteRule ^our-cast.aspx$ /meet-our-cast/ [R=301,L]
      RewriteRule ^area-links.aspx$ /area-links/ [R=301,L]
      RewriteRule . /index.php [L]
      RewriteCond %{HTTP_HOST} ^test.countrytonitepf.com$
      RewriteCond %{REQUEST_FILENAME} !-f
      RewriteCond %{REQUEST_FILENAME} !-d
      </IfModule>

      # END WordPress
      {{ DiscussionBoard.errors[8563282].message }}

Trending Topics