Welcome to WebmasterWorld Guest from 220.127.116.11
Forum Moderators: open
Even though that URL is long, it still only has two variables.
On my site I use rewrites heavily to make MySQL & PHP generated pages look like .html pages. The lengths of some of the URLs are incredible with all the variables listed, and they are being crawled.
Yes, you are right. I originally had three variables but shortened it to two when I realized Google wasn't indexing them. Unfortunately it still wouldn't take the page because of the multi-part second variable. Now it is.
If anyone wants help with mod_rewrite, do a site search for the term and you'll hit a goldmine. There are lots of helpful folks here but they aren't going to comb through the busy Google News forum. Try the Perl forum.
Here is an example :
This would be contained in your .htaccess file on your Apache server.
deny from all
RewriteRule ^profile(.*).html /member.php?ppaction=profile&uid=$1 [L]
RewriteRule ^album(.*)-user(.*).html /showgallery.php?cat=$1&ppuser=$2 [L]
I will explain each line.
The first three lines prevent people from viewing the contents of your .htaccess file. (Security)
The 4th line turns the rewrite engine to on. This must be turned on in order to do the rewrites.
The 5th line turns off autmatic index creation on directories without an index file. (Security)
Now on the the actual rewrites.
The 6th line uses only one variable. So if I call www.site.com/profile10.html the server extract the value between "profile" and the ".html" and makes $1 the value. So now member.php?ppaction=profile&uid=$1 becomes member.php?ppaction=profile&uid=10
The 7th line uses two variables. I call www.site.com/album23-user4.html the server extracts the value between "album" and "-user" making this value variable $1. The next portion of the url is between "-user" and ".html" taking this value variable $2.
So now album www.site.com/album23-user4.html becomes www.site.com/showgallery.php?cat=23&ppuser=4
You can take these examples and make .html pages with as many variables as you wish.
Hope this helps.