.htaccess url rewriting problem
- by letsworktogether
I'm kind of stuck at this part and was hoping that I'd get some assistance. I'm building a highscores page in PHP, that's going great, it works. however, I dislike the idea of "index.php?skill=name" and therefore wanted a bit of SEO in this.
I have successfully replaced the url with a more friendly version: "highscores/skill/name"
And this is where the problem starts, I have added pagination to the highscores and the page is read from the HTTP_GET page variable ($_GET['page']).
I dislike the idea of "highscores/skill/name&page=2" and was hoping if you guys could assist me to make the url like the following:
Page 1, so accessing the file without declaring the page number:
DOMAIN.TLD/highscores/skill/name
Page 1 so now the page variable is needed:DOMAIN.TLD/highscores/skill/name/2
As you can tell the "2" will define page 2 and load the correct data for page 2. However, I'm having much trouble in my .htaccess file to configure it this way.
RewriteRule ^highscores\/skill\/(.*?)(\/(.*?)*)$ highscores/skills.php?skill=$1&page=$2 [L] # Skills page
That is my latest attempt in order to get it to work, unfortunately it does not work, it makes the page look horrible (CSS doesn't work) and it doesn't go to the page specified on the URL.
I hope you understand my issue,
thank you!