Page is a not externally linkable
- Code, Content, and Presentation
-- Apache Web Server
---- SEO friendly URLs Part 2


g1smd - 8:39 pm on Jan 21, 2013 (gmt 0)


RewriteCond %{THE_REQUEST} [A-Z]{3,9}\ /register\.php\?mode=create&usertype=pri\ HTTP
RewriteRule ^register\.php$ /manufacturers-sales-reps-register.php? [NC,L,R=301]

RewriteRule ^/manufacturers-sales-reps-register\.php http://www.example.com/register.php?mode=create&usertype=pri [L]

There are several errors in the above code.

The target of the external redirect should contain protocol and hostname. Try this:

RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /register\.php\?mode=create&usertype=pri\ HTTP/
RewriteRule ^register\.php$ http://www.example.com/manufacturers-sales-reps-register.php? [R=301,L]


The target of the internal rewrite should not include the protocol or hostname. Including those turns the rule into a 302 redirect. The pattern for the rewrite should not begin with a leading slash. Try this:

RewriteRule ^manufacturers-sales-reps-register\.php /register.php?mode=create&usertype=pri [L]

Consider NOT including the .php bit in the friendly URL.

Add a blank line after every rule to make the code more readable.


Thread source:: http://www.webmasterworld.com/apache/4537982.htm
Brought to you by WebmasterWorld: http://www.webmasterworld.com