1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

.htaccess wont process rewrite rule despite many attempts

Discussion in 'Apache' started by gbrent, Apr 1, 2015.

  1. #1
    It should be a straight forward change. http://example.com/denver-cars/ does not redirect tohttp://example.com/newcars-in-denver/. It simply tries to load /denver-cars/ and denver-cars is in the URL. Am I missing something here? I have tried moving it up and down the list of rules and have tried numerous types of flags to no avail. Everything else in the htacess works fine with out the line:RewriteRule ^/(.*)-cars/ /newcars-in-$1/ [NC,R=301,L]

    Here is my htaccess:
    Options +FollowSymlinks
    RewriteEngine on
    RewriteBase /

    # Force www

    # Redirect google index dir's to new dir
    RewriteRule ^/(.*)-cars/ /newcars-in-$1/ [NC,R=301,L]

    # Disable rewrite for Folder Names
    RewriteCond %{REQUEST_FILENAME} [NC,OR]
    RewriteCond %{REQUEST_FILENAME} [NC,OR]
    RewriteCond %{REQUEST_URI} ^awstats
    RewriteRule .* - [L]

    # Permit pretty URL directories
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . / [L]
     
    gbrent, Apr 1, 2015 IP
  2. [ET]Alexander

    [ET]Alexander Well-Known Member

    Messages:
    66
    Likes Received:
    8
    Best Answers:
    0
    Trophy Points:
    100
    #2
    What hosting provider are you currently utilizing? VPS or Shared?
     
    [ET]Alexander, Apr 1, 2015 IP