#1
  1. No Profile Picture
    Registered User
    SEO Chat Explorer (0 - 99 posts)

    Join Date
    Jan 2013
    Posts
    8
    Rep Power
    0

    RewriteRule 301 Problem


    Hey guys,

    Just having an issue with .htaccess RewriteRule. I need the RewriteRule to be 301. The rewrite works when I don't use the [R=301] tag, but when I used it the rewriterule won't work. Any ideas what I am doing wrong? Thanks!!!!

    Here is my code:
    Code:
    RewriteEngine On
    RewriteCond %{REQUEST_URI} !(\.[^./]+)$
    
    RewriteRule ^blog/(.*)$ blog/blog.php?pid=$1 [R=301]
    The dynamic link I am using is:

    Example Domain
  2. #2
  3. No Profile Picture
    Registered User
    SEO Chat Explorer (0 - 99 posts)

    Join Date
    Jan 2013
    Posts
    8
    Rep Power
    0
    I figured out the problem. This is what I used if anyone else runs into the same problem. Two rewrite rules are required as follows:

    RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /blog/blog\.php\?pid=([a-z0-9]+)\ HTTP/ [NC]
    RewriteRule ^blog/blog\.php$ Example Domain [R=301,L]


    RewriteRule ^blog/([-a-z0-9]+)$ /blog/blog.php?pid=$1 [NC,L]

Similar Threads

  1. RewriteRule from php2html + redirect
    By uzidesign in forum Web Design, Coding and Programming
    Replies: 0
    Last Post: Jun 12th, 2008, 06:41 PM
  2. RewriteRule - URL - Hebrew.
    By MasterT in forum Web Design, Coding and Programming
    Replies: 2
    Last Post: Mar 3rd, 2008, 08:31 AM
  3. Could a RewriteRule be seen as spam to an engine?
    By BoarsHell in forum Search Engine Optimization
    Replies: 6
    Last Post: Jun 16th, 2005, 04:20 PM
  4. RewriteRule small glitch, please help
    By FrzzMan in forum Search Engine Optimization
    Replies: 0
    Last Post: Apr 7th, 2005, 03:24 PM

IMN logo majestic logo threadwatch logo seochat tools logo