Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie
Hi there,
There is an issue with role permissions that is being worked on at the moment.
If you are having trouble with access or permissions on regional forums please post here to get access: https://www.boards.ie/discussion/2058365403/you-do-not-have-permission-for-that#latest

Help! Mod_rewrite rewrite rules being ignored

  • 19-09-2009 9: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