Support

Admin Tools

#14796 .htaccess redirect

Posted in ‘Admin Tools for Joomla! 4 & 5’
This is a public ticket

Everybody will be able to see its contents. Do not include usernames, passwords or any other sensitive information.

Environment Information

Joomla! version
n/a
PHP version
n/a
Admin Tools version
n/a

Latest post by user71930 on Saturday, 02 February 2013 03:59 CST

user71930

Mandatory information about my setup:

Have I read the related troubleshooter articles above before posting (which pages?)? yes, .htacess chapter
Have I searched the tickets before posting? yes
Have I read the documentation before posting (which pages?)? yes
Joomla! version: 2.5.8
PHP version: (unknown)
MySQL version: (unknown)
Host: (optional, but it helps us help you)
Admin Tools version: 2.4.4

Description of my issue:    I used the the .htacess maker and it's working fine with my site. However, there are a couple of links that are not redirecting to my 404 page or the front page. So, I was wondering, what code do I need to use to redirect specific pages from my site to a 404 or the main page of my site? 

 

 

nicholas
Akeeba Staff
Manager

What is the URL you are trying to access? What is the expected result? What actually happens? Please help me help you.

Nicholas K. Dionysopoulos

Lead Developer and Director

🇬🇷Greek: native 🇬🇧English: excellent 🇫🇷French: basic • 🕐 My time zone is Europe / Athens
Please keep in mind my timezone and cultural differences when reading my replies. Thank you!

user71930

Thanks for the response Nicholas. The url's that I'm trying to redirect to 404 pages are: www.mysite.com/function.file-get-contents       and     www.mysite.com/component/jinc/?view=notice&tmpl=component&id=1&iframe=true&width=700&height=500 

When I go to these url's my hosting companies url is showned not my sites. I want to redirect these two url's to my siites 404 page. So, I was wondering what custom rule I would add to the .htaccess maker. 

nicholas
Akeeba Staff
Manager

The former URL is not handled by Joomla! because the "extension" seen by Apache is .file-get-contents. This doesn't match the extensions Joomla! is suppsed to handle (no extension, .php, .htm, .html, .xml, .raw). You need to add a custom .htaccess rewrite rule if you want to redirect this URL.

The latter URL should already be handled by Joomla!.

Nicholas K. Dionysopoulos

Lead Developer and Director

🇬🇷Greek: native 🇬🇧English: excellent 🇫🇷French: basic • 🕐 My time zone is Europe / Athens
Please keep in mind my timezone and cultural differences when reading my replies. Thank you!

user71930

I don't know much code, how do I go about rewriting the rule to redirect to the 404 page. Could you possibly tell me how to do it? 

nicholas
Akeeba Staff
Manager

You would need to add something like that to the "Custom .htaccess rules at the top of the file" section of .htaccess Maker:

Redirect function.file-get-contents http://www.example.com/your-404-page.html
R
ewriteCond %{QUERY_STRING} view=notice
RewriteRule ^component/jinc$ http://www.example.com/your-404-page.html [L]

Nicholas K. Dionysopoulos

Lead Developer and Director

🇬🇷Greek: native 🇬🇧English: excellent 🇫🇷French: basic • 🕐 My time zone is Europe / Athens
Please keep in mind my timezone and cultural differences when reading my replies. Thank you!

user71930

I tried adding the code, however it didn't work. Could you possibly take a look at my site and fix it? 

nicholas
Akeeba Staff
Manager

No, sorry. Customised .htaccess code is custom consultancy, not Admin Tools support. I can't provide custom consultancy and honestly don't have time for consultancy.

Nicholas K. Dionysopoulos

Lead Developer and Director

🇬🇷Greek: native 🇬🇧English: excellent 🇫🇷French: basic • 🕐 My time zone is Europe / Athens
Please keep in mind my timezone and cultural differences when reading my replies. Thank you!

user71930

Can I get custom consultancy if I pay for the extra support? 

nicholas
Akeeba Staff
Manager

No, money is not the problem. Time (actually, the lack of it) is. If I had the time to do this kind of site debugging I'd do it for free :) The problem is that the last 12 days I'm working 16 hours per day. I'm no stranger to that. This kind of workload peaks happen every 2 months and last for 2-3 weeks. The only problem is that during those peaks I have to turn down consultancy, even small scale like yours :(

Nicholas K. Dionysopoulos

Lead Developer and Director

🇬🇷Greek: native 🇬🇧English: excellent 🇫🇷French: basic • 🕐 My time zone is Europe / Athens
Please keep in mind my timezone and cultural differences when reading my replies. Thank you!

user71930

Thanks anyways Nicholas! I'll try it myself and see what happens. 

Support Information

Working hours: We are open Monday to Friday, 9am to 7pm Cyprus timezone (EET / EEST). Support is provided by the same developers writing the software, all of which live in Europe. You can still file tickets outside of our working hours, but we cannot respond to them until we're back at the office.

Support policy: We would like to kindly inform you that when using our support you have already agreed to the Support Policy which is part of our Terms of Service. Thank you for your understanding and for helping us help you!