Welcome to the myhosting.com Forums.
-
Redirect problems
There are some unsavory sites linking to non-existent posts on the forum I have hosted here. I would like to return a 404 not found error for these links.
I have several blogs and forums at other hosts and have used htaccess files to handle redirects before. After hours of tearing my hair out I have not been able to do the most basic permanent redirect. Either nothing happens or I get a 500 server error.
Has anyone been able to redirect on a requested URL basis? Is it possible with the limitations posed by myhosting??
I am trying to redirect URLs like:
^viewtopic.php?f=45&t=6$ to either my 404.php or to any non-existent file such as goaway.php
I tried live chat support but they are offline.
Thanks
-
Re: Redirect problems
Does anyone ever read these forums? It seems real quiet here, not much input and myhosting personnel stay away too. :?
-
Re: Redirect problems
Hello Havuz,
Sorry for the lack of reply. I haven't had an opportunity to look into this issue yet. I have to admit I'm not overly experienced with administering forums such as phpBB. To confirm, is your forum on phpBB, vBulletin or something else?
Thanks.
-
Re: Redirect problems
Hi tima
The forum uses phpBB and you can visit it by following the link in my signature.
The problem I am experiencing is independent of phpBB, php, MySQL, html, and similar languages and software. The problem is related to Apache's mod_rewrite module as used in an .htaccess file in a folder root. It concerns a server request - server response relationship and has nothing to do with the resource or file being requested.
I have requested support via email and have received an initial response (saying "the issue wil be reviewed"). I hope this gets solved quicker than my last support ticket which took over 6 months to get a final response. At least the reply here on the forum took less than a week!
-
Re: Redirect problems
Hello Havuz,
I've talked to one of our Developers and one of our SysAdmins about this issue. Yes, you can create a RewriteRule and a 404 redirection in your .htaccess file. But it would seem that the problem is within the phpBB application. When a user browses to a link that does not exist, phpBB is being "helpful" and redirects the user to a nice "HTTP 200 OK" page.
Perhaps there is a setting, plugin or mod for phpBB which will allow you to bypass this behavior and rely instead on the 404 handling you define in your .htaccess file.
-
Re: Redirect problems
Hi Tim and thanks for the quick response 
This problem has been awaiting a response from myhosting for almost a week. I was tired of waiting for the support team to respond (previous experience has shown that the wait could be months). I was able to configure the forum software as an interim solution.

Originally Posted by
You
When a user browses to a link that does not exist, phpBB is being "helpful" and redirects the user to a nice "HTTP 200 OK" page.
If you had taken a look at my forums you would have seen that a user request for a topic that does not exist returns a 302 page moved temporarily and then that in turn gives a 404 page not found. A request for a page that does not exist returns a 404 page not found. Your comment regarding a 200 page found response is not the case on my forums!

Originally Posted by
I
The problem I am experiencing is independent of phpBB, php, MySQL, html, and similar languages and software. The problem is related to Apache's mod_rewrite module as used in an .htaccess file in a folder root. It concerns a server request - server response relationship and has nothing to do with the resource or file being requested.
:geek: I would like to be able to elicit a 404 response or do a permanent redirect without having to go through software redirect chains linked to dynamic website applications. I want to be able to do redirects according to the server request and this is the help I am asking for. This question is not about phpBB, WordPress, Joomla, Drupal, Magento, Concrete or any other LAMP based dynamic CMS software, it is about the Apache server and Apache server modules installed on the server space I rent from myhosting.

Originally Posted by
You
you can create a RewriteRule and a 404 redirection in your .htaccess file
The .htaccess support is extremely limited so could you please provide an example (based on the requested URL in my first post) of a redirect I could use. The wiki example doesn't work. I am not able to set Options +Follow SymLinks. I don't know the level of wildcard support available as I have yet to succeed in setting up a redirect. A few examples would allow me to evaluate the scope of the limited use you offer for the mod_rewrite module.
Thanks
-
Re: Redirect problems
Hi Havuz,
This is beyond my abilities, but I've got some feedback for you, hopefully it will help.
The URLs contain parameters, so Redirect or RedirectMatch will not work.
It is necessary to use mod_rewrite but matching the parameters (those after
the '?'). They are not considered part of the URL.
Code:
RewriteEngine On
RewriteCond %{QUERY_STRING} f=45&t=6
RewriteRule .* - [F]
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
Forum Rules
Version 4.1.7
Copyright ©2000 - 2013
All times are GMT -4. The time now is 07:06 AM.