[PHP?] Folders

Its well worth doing. I did it on a work site and within a week we had 10000 pages in google, never had more than about 200 before that

Aaron
 
Pretty confusing.

How would I change, for example, blah.com/index.php?page=news&news=7 to blah.com/news/7/?

I really can't work it out at all.
 
Thanks!

Pretty simple :rolleyes:
I don't understand ([0-9]+)
How do I change that so it can include letters?
So if news=franky, it would go to /news/franky/
Or am I making crazy things up?

edit: also, is there a way to use relative links for images now?
 
To be fair, it is pretty simple if you actually read the documentation. You can't assimilate everything instantly :)

Code:
RewriteEngine On
RewriteRule ^news/([^/]+)/?$ index.php?page=news&news=$1 [QSA]

That'll allow any non-forward-slash characters, so news/foo/, news/@:[]Dbleurg`"/ and news/1222/.

Make sure you're sanitising your input appropriately in your script.
 
Back
Top Bottom