Forum Moderators: phranque
RewriteRule ^brand/([^/]+)/page[0-9]+\.html$ /brand/$1.html?page=$2 [L]
Options +FollowSymLinks
RewriteEngine on
This stuff is complicated at first, and can be very dangerous to your search engine rankings. Please devote the time that your site deserves to studying the documents cited in our forum charter [webmasterworld.com] and the tutorials in the Apache forum section of the WebmasterWorld library [webmasterworld.com]. Then proceed and experiment cautiously, until you get comfortable with it. We welcome specific questions here!
Jim
However, when I click to /brad/brandpage/page2.html I am being displayed the first page still.
Also, I realize I am walking in dangerous waters in regards to SEO. I was hoping to impliment a 301 after I got the rewrite working smoothly. (A 301 from /brand/Some_Stuff.html?page=10 to /brand/Some_Stuff/page10.html )
I am wondering if this matters any:
/brand/..etc is rewritten:
RewriteRule ^brand/([^.]+)\.html$ index.php?manufacturers_id=$1&%{QUERY_STRING} [NC,L]
so essentially, am I re-rewriting with:
RewriteRule ^brand/([^/]+)/page([0-9]+)\.html$ /brand/$1.html?page=$2 [L]
Initially, the bald URL(s) are:
index.php?manufacturers_id=99
1st rewrite: /brand/brand99.html
2nd rewrite: /brand/brand99/page2.html
Should the two be condensed or does it not matter having 2 rewrites for the same URL?
Always place more-specific external redirect rules first, then less-specific, and end up with your "catch-alls". After that, start your most-specific internal rewrites, then less-specific, then catch-alls.
Each rule should be written to take the requested URL and rewrite or redirect it to the final destination, avoiding intermediate steps whenever possible.
This is a ranking-related issue for external redirects, and an efficiency-related issue for internal rewrites. Doing all of your external redirects first avoids having them "expose" your internal rewrites to clients.
Jim
As for my other rules, they aren't really related to these pages at all, as they rewrite other URL structures / portions of the site.
I'm having a bit of difficulties merging the two together.
I would like the first bit to remain without a number, but once I get to pages 2 and beyond, to use the pageXX.html
Am I looking at this correctly?
RewriteRule ^brand/([^/]+)/([0-9]+)\.html$ /brand/$1.html?page=$2 [L]
Or do you recommend simply dropping the "page"? By my preferences, I don't really have a preference for keeping it. I just want clean looking URLs that bots can follow easily.