Raise 403 error for specific menu items

Discuss Search Engine Optimization in relation to Joomla! 3.x. This forum will also have discussions on SEF/SEO Joomla! 3.x extensions.

Moderator: General Support Moderators

Forum rules
Forum Rules
Absolute Beginner's Guide to Joomla! <-- please read before posting, this means YOU.
Forum Post Assistant - If you are serious about wanting help, you will use this tool to help you post.
Locked
Haady
Joomla! Fledgling
Joomla! Fledgling
Posts: 3
Joined: Tue Sep 11, 2012 10:24 am

Raise 403 error for specific menu items

Post by Haady » Mon May 27, 2013 1:24 pm

Hi,

Is there a way to raise 403 error for specific menu items? So when visitor hits a link server should return 403 error like when you have forbidden folder.

I do not want to redirect it any where or similar. I just want to show visitor error page with 403 response.

I am using Joomla 3.0 with JA Travel template.
Thanks.
Ante.

paulera
Joomla! Explorer
Joomla! Explorer
Posts: 324
Joined: Tue Sep 07, 2010 5:23 pm
Location: Ireland
Contact:

Re: Raise 403 error for specific menu items

Post by paulera » Mon May 27, 2013 11:24 pm

PHP code to force 403 error:

Code: Select all

<?php
header("HTTP/1.0 403 Forbidden");
die();

Haady
Joomla! Fledgling
Joomla! Fledgling
Posts: 3
Joined: Tue Sep 11, 2012 10:24 am

Re: Raise 403 error for specific menu items

Post by Haady » Tue May 28, 2013 6:49 am

paulera wrote:PHP code to force 403 error:

Code: Select all

<?php
header("HTTP/1.0 403 Forbidden");
die();
Thanks for that, but I have already knew that :D . The thing is that I want to ad that for specific menu items. Not all, but enough to exclude hard coding. Is there some possibility to add this trough joomla interface, or some extension (I could not find any)?

Thanks!
Ante.

paulera
Joomla! Explorer
Joomla! Explorer
Posts: 324
Joined: Tue Sep 07, 2010 5:23 pm
Location: Ireland
Contact:

Re: Raise 403 error for specific menu items

Post by paulera » Tue May 28, 2013 4:54 pm

To inject PHP code in Joomla without needing to hardcode files, you can use Jumi to create a menu item that calls exactly the code above. Take a closer look.

Sourcerer is also a great extension to inject PHP code, but I don't not know if it allows the creation of a specific menu item... but you could inject the code inside an article or module and job done, too!


Locked

Return to “Search Engine Optimization (Joomla! SEO) in Joomla! 3.x”