block access to certain pages in magento

i have a category in my store, lets call it Program, this category will only have 1 product, lets call it Program product, so, i’ve developed a module only to show this category and product, the view is diferent from the others categories, so, if i write in my browser the url
myweb.com/index.php/program.html or myweb.com/index.php/program-product.html i can see the custom categories page or the product view page and i don’t want that, i want that if someone write this url he will be redirect to another one, how can i do that, if it is posible

thanks

2 thoughts on “block access to certain pages in magento”

  1. “Do you want the category to show in the category menu but link to your new URL and not show in the old one?”

    “yeah, this is exactly what i want, is this possible??”

    Try this; Go to the menu Catalog > URL Rewrite Management and find the entry for your category. Crucially it’s target path will look something like “catalog/category/view/id/123” (‘catalog’ is the module, ‘category’ is the controller, ‘view’ is the action and ‘id/123’ is a parameter).

    Follow these URL rewrite instructions to delete the above entry then create a replacement. It’s only difference will be the target path, use your module’s path along with whichever controller, action and parameters are suitable for this case.

    By preserving the ID Path of the old rewrite rule you are ensuring it doesn’t get overwritten, although I haven’t tested this with rebuilding indexes.

  2. Does the category’s enabled setting, and the product’s visibility setting affect your module’s display? If not use those settings to hide them from the catalog but continue using your module as normal.

Leave a Reply

Your email address will not be published. Required fields are marked *