Results 1 to 2 of 2

Thread: Friendly URL help

  1. #1
    Join Date
    Apr 2012

    Friendly URL help

    Hi all!

    I have the link below which I created to test the functionality of the script I wrote. But because the rest of my site is setup with friendly or extensionless URLs, I want to do the same with this one:

    PHP Code:
    "<a href='meta-paginated.php?page=$i'>$i</a> ";
    This is the current rewrite rule I have in my .htaccess which works fine for normal links:

    RewriteRule ^(([^/]+/)*[^/.]+)$ index.php?page=$1 [L]
    So the question is,because I cant work it out.

    1. What would the regex be for this scenario?

    2. How would I need to change the link to work with the new rewrite rule and still select ?page 1,2,3,4,5, etc etc. The page ID is always a number?

    Many thanks in advance. If you are kind enough to provide the solution would you be able to explain how you get there so I can learn and pass on my knowledge to other forum users in the future?

    Just to add:


    This is the link in a raw format:


    This is what the URL looks like:


    This is the rule I think it should be but not completely sure:

    RewriteRule ^meta-paginated/(.*)/(.*)/$ /meta-paginated.php?$1=$2

    I am also not sure of the LINK construct that is why I havent listed it here.
    Last edited by chrisguk; 04-25-2012 at 03:59 AM.

  2. #2
    Join Date
    Apr 2012
    See http://www.edinteractive.co.uk/article/?id=48

    You need to put the following lines into your .htaccess file:

    RewriteEngine On
    RewriteRule /page/(.*)$ /page/page.php?id=$1

    This basically tells your website that any request for your page should be re-written. Doing this will mean that your addresses will become further simplified to the following:
    Not sure if it works.. Simple google on terms 'htaccess friendly url'

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
HTML5 Development Center