Status
Not open for further replies.
4 comments
Forgot about the different pages for you.

OPTION 1


Code:
RewriteRule ^(.*)-page-([0-9]+).html$ index.php?type=$1&page=$2

If you add the above extra line to your htaccess file it will allow the following types of pages. The disadvantage of this is you can't use your own type names and they must be app, movie game etc and not software, movies, games etc.

Code:
http://example.com/movie-page-3.html
http://example.com/music-page-12.html
http://example.com/ebook-page-234.html
http://example.com/app-page-234.html

OPTION 2

That's when you try and have one rule for each. The other option is to have a rule for each type which gives you more flexibility and let's you customize it more.

Code:
RewriteRule ^movies-page-([0-9]+).html$ index.php?type=movie&page=$1
RewriteRule ^music-page-([0-9]+).html$ index.php?type=music&page=$1
RewriteRule ^software-page-([0-9]+).html$ index.php?type=app&page=$1
etc..

You'll see here how you can have the link say software when it inserts the type as app and will allow urls like the following
Code:
http://example.com/movies-page-3.html
http://example.com/music-page-12.html
http://example.com/ebooks-page-234.html
http://example.com/software-page-234.html

OPTION 3

Expanding on option 2 we can change the format of the url
Code:
RewriteRule ^movies/([0-9]+).html$ index.php?type=movie&page=$1
RewriteRule ^music/([0-9]+).html$ index.php?type=music&page=$1
RewriteRule ^software/([0-9]+).html$ index.php?type=app&page=$1
etc..

Will allow urls like the following
Code:
http://example.com/movies/3.html
http://example.com/music/12.html
http://example.com/ebooks/234.html
http://example.com/software/234.html

OPTION 4

Expanding on option 3 we can change the format of the url
Code:
RewriteRule ^movies/page-([0-9]+).html$ index.php?type=movie&page=$1
RewriteRule ^music/page-([0-9]+).html$ index.php?type=music&page=$1
RewriteRule ^software/page-([0-9]+).html$ index.php?type=app&page=$1
etc..

Will allow urls like the following
Code:
http://example.com/movies/page-3.html
http://example.com/music/page-12.html
http://example.com/ebooks/page-234.html
http://example.com/software/page-234.html


That should be more than enough of a choice :)
rep me :P
 
Last edited:
Status
Not open for further replies.
Back
Top