Advertisement
Help Keep Boards Alive. Support us by going ad free today. See here: https://subscriptions.boards.ie/.
If we do not hit our goal we will be forced to close the site.

Current status: https://keepboardsalive.com/

Annual subs are best for most impact. If you are still undecided on going Ad Free - you can also donate using the Paypal Donate option. All contribution helps. Thank you.
https://www.boards.ie/group/1878-subscribers-forum

Private Group for paid up members of Boards.ie. Join the club.

Help! Mod_rewrite rewrite rules being ignored

  • 19-09-2009 10:56PM
    #1
    Closed Accounts Posts: 12,382 ✭✭✭✭


    Hello

    I hope someone can help me with this.

    I am trying to make the pagination URLs on a site of mine search engine friendly.

    An example of the URLs is:

    http://empleobcn.es/index.php?&page=2
    http://empleobcn.es/index.php?&page=3
    http://empleobcn.es/index.php?&page=4
    Etc.

    I have the following in my .htaccess:

    RewriteEngine On
    RewriteRule ^page/([0-9]+)\.php$ index.php?&page=$1 [L]

    However, the URLs are not being rewritten.

    Am I doing something stupid, for example, do I need to change the URLs to something like http://empleobcn.es/page/2.php in my script, and then use .htaccess to rewrite the URL to what it really should be?

    Any help appreciated.

    Thanks!


Comments

  • Closed Accounts Posts: 1,200 ✭✭✭louie


    Yes, your URL needs to be changed to match the RULE in your htaccess file

    so if your rule is
    RewriteEngine On
    RewriteRule ^page\/([0-9]+)\.html$ index.php?&page=$1 [L,NC]
    

    your URL should be

    www.websitename.com/page/2.html


  • Closed Accounts Posts: 12,382 ✭✭✭✭AARRRGH


    Thanks, I had a feeling it was something like that, but didn't want to go changing scripts until I had some confirmation.

    Cheers!


Advertisement