2
   

The definitive guide to phpBB mod_rewrite problems/errors

 
 
Reply Thu 3 Feb, 2005 06:32 pm
As far as I remember, every single possible reason that my mod_rewrite can go wrong for you is listed here. I will start simply directing people here instead of repeating myself. If this doesn't solve your problems this is due to one of the following things:

  • Error in understanding
  • Error in implementation
  • Platform that does not support a solution


Feel free to ask questions here, but if I don't answer them it will mean they are questions that are already answered in this post.

1) Check to see if you have access to mod_rewrite, the 403 errors usually mean no access to this or a syntax error in the .htaccess file. Don't do this by seeing what modules Apache is loading, or by looking at the phpinfo output. Do this by testing a simple rewrite. If you do not have access to mod_rewrite, mod_rewrite will not work and you should speak to your server administrator about this.

Here is an example (for most platforms) test.

  • Make an directory on your site.
  • Make a file called bar.html in this directory with the following string "Happy happy joy joy".
  • Make an .htaccess file with the following
    [code]
    RewriteEngine On
    RewriteRule ^foo.* bar.html [L,NC]
    [*]Attempt to access foo.html in this directory with your browser.
    [/code]
  • If you see the content in the bar.html file, the rewrite worked.



2) Did you create the .htaccess file correctly? It should be exactly that, nothing else.

  • Sometimes your operating system will hide known extensions (you can change this setting in windows, ask how on the computer forum) and your file might really be htaccess.txt
  • Sometimes your operating system or text editor will not allow you to save a file beginning with a period. You can save it as htaccess.txt and rename it on the server through your ftp client.
  • Sometimes your FTP client will hide files that begin with periods, you can usually change a setting to have it show them to you. If you have questions about your FTP client ask on the computer forum.


3) Did you put the .htaccess file in the right place? It should be placed IN THE FORUM'S DIRECTORY (big letters because this seems to be ignored both in the mod instructions and in attempts to help people who put it elsewhere).

4) Do you need a rewritebase added to your .htaccess file? Some configurations need this. See if it helps you.

In your .htaccess file:

FIND

Code:
RewriteEngine On


REPLACE WITH
Code:
RewriteEngine On
RewriteBase /


See if that solves your problems.

5) Are other rewrite rules or mods conflicting with this one? Don't ask me, I don't know what you are running. :-D I also can't spend time trouble shooting other people's mods or maintaining universal compatibility with anything anyone might decide to do to their forums.

6) We are talking about phpBB right? My mod is for phpBB, not phpnuke, mambo or any other ported phpBB.

=======================

Bonus tips ;-)

  • If you get 404's then check your error logs for where the request is failing, don't expect others to magically know when you have the data and they don't. Have a look at your logs and see. If don't understand the logs then post them for other to answer. Don't expect people to magically know what your server is doing.
  • The mod is restricted to guests. Don't test it while logged in.
  • If you install the mods perfectly it still doesn't mean your site will be indexed, this depends on search engine algorithms. The mod opens the door for them, whether or not they want to come in is based on their algorithms. Most of the time you can get them to index you by getting backlinks.


=======================


If I have missed anything, feel free to point it out and if it really isn't covered above, I will add it.
  • Topic Stats
  • Top Replies
  • Link to this Topic
Type: Discussion • Score: 2 • Views: 24,329 • Replies: 54
No top replies

 
omid2222
 
  1  
Reply Fri 4 Feb, 2005 03:50 am
If i have 500 Error not 403 or 404???
I have 500 Error by .htaccess.
what is that?
0 Replies
 
Craven de Kere
 
  1  
Reply Tue 8 Feb, 2005 12:22 am
It's an internal server error and can probaby be solved by the steps I have outlined.
0 Replies
 
infoguy26
 
  1  
Reply Thu 17 Feb, 2005 09:42 pm
I tried to do your test with bar.html and got this error:

Quote:
Internal Server Error
The server encountered an internal error or misconfiguration and was unable to complete your request.
Please contact the server administrator, [email protected] and inform them of the time the error occurred, and anything you might have done that may have caused the error.

More information about this error may be available in the server error log.


Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.
0 Replies
 
infoguy26
 
  1  
Reply Fri 18 Feb, 2005 12:40 pm
Rolling Eyes
0 Replies
 
infoguy26
 
  1  
Reply Fri 18 Feb, 2005 03:44 pm
Can you provide any more information as to what could be the cause? Because not even my server admins understand why this isnt working. We have followed the instructions perfectly.
0 Replies
 
infoguy26
 
  1  
Reply Fri 18 Feb, 2005 04:18 pm
Also, when you say:

Quote:

Make a file called bar.html in this directory with the following string "Happy happy joy joy".


do you mean name a file as "bar.html Happy happy joy joy" or a file named bar.html with that text located inside of it? Do we substitute the spaces with underscores? Such as Happy_happy_joy_joy?
0 Replies
 
infoguy26
 
  1  
Reply Fri 18 Feb, 2005 04:53 pm
Well I managed to figure out the problem myself. I know the reason why this site is named "able2know" now, because I am able to know that the support here is crap. You forgot to mention that this wouldnt work on IP based addresses. My test site didnt have a domain assigned to it which resulted in all of the errors.
0 Replies
 
Craven de Kere
 
  1  
Reply Fri 18 Feb, 2005 05:06 pm
infoguy26 wrote:
I know the reason why this site is named "able2know" now, because I am able to know that the support here is crap.


infoguy26,

I have no obligations to "support" you. I publish free code and help people when I can because I enjoy doing so. I haven't been online and haven't even seen your requests for help, but quite frankly it's very disheartening to be treated rudely just because I didn't cater to you to your liking.

If you dislike this site, and my efforts to support my code for free then don't use either. The fact that I give out free code and you can't figure out how to use it does not justify your sense of entitlement.

I don't owe you "support", I support people for free when I have the time because I like to help others. Your selfish and petulant whining is not a good way to get favors out of people.

That is the type of behavior that makes so many open source coders stop helping people.

Quote:
You forgot to mention that this wouldnt work on IP based addresses.


It's hardly my fault that you didn't know a basic thing about how your server works.

It's rude to blame people who try to disseminate information and help others just because they didn't happen to address a particular point of your own ignorance.
0 Replies
 
infoguy26
 
  1  
Reply Fri 18 Feb, 2005 08:55 pm
Craven de Kere wrote:

Quote:
You forgot to mention that this wouldnt work on IP based addresses.


It's hardly my fault that you didn't know a basic thing about how your server works.

It's rude to blame people who try to disseminate information and help others just because they didn't happen to address a particular point of your own ignorance.


My point was from the line in this topic

Quote:

As far as I remember, every single possible reason that my mod_rewrite can go wrong for you is listed here.


I am stating that not every single reason for this mod to work is stated in this topic, and I am being rude because you ask why people do not understand why they have problems and the reason for that is due to your lack of explaining how your script works. My comment was due to the frustation of spending hours figuring out why this isnt working since I trusted your statement about every possible reason for your mod not to work is listed in this topic, which isnt true. So the fault is yours not those who have trouble with it.
0 Replies
 
Craven de Kere
 
  1  
Reply Sat 19 Feb, 2005 03:11 pm
Your problem is covered above in my initial post. Your account did not have access to mod_rewrite because you weren't running it under a domain.

I publish rewrite rules and do not publish the mod_rewrite apache module. I provided a means for you to test whether you can rewrite or not and your test illustrated that you could not do so.

Craven, in the first post in this thread wrote:
If you do not have access to mod_rewrite, mod_rewrite will not work and you should speak to your server administrator about this.



infoguy26 wrote:
I am being rude because you ask why people do not understand why they have problems and the reason for that is due to your lack of explaining how your script works.


infoguy, let's get something straight. You don't understand it because of your lacking understanding, not because I failed to address all possible ignorance about webservers.

I'd like to again repeat that I have no obligations to you. I publish help because I like to help and if I have failed to pre-empt a particular point of your ignorance this is hardly something to treat me rudely for.

Quote:
My comment was due to the frustation of spending hours figuring out why this isnt working since I trusted your statement about every possible reason for your mod not to work is listed in this topic, which isnt true.


That is a falsehood. I provided a means for you to discover that you did not have access to mod_rewrite and told you to contact your server admin.

I am not your server admin. I do not publish mod_rewrite.

Here's an analogy:

1) I publish code that requires Windows XP.

2) I tell you how to check whether you have Windows XP and inform you that if you don't you can't run the code successfully.

3) You decide to blame me for your lacking access to XP.

It is not my fault that you and your server admin did not know how to use your server well enough to use these simple rewrite rules. I can understand that it can be frustrating to not know something but it is not any less frustrating when people selfishly blame you for their own ineptitude.

Quote:
So the fault is yours not those who have trouble with it.


infoguy26, you just don't get it. I am not responsible for your ignorance.

If you don't know something about software that runs on your server and that I have nothing whatsoever to do with (I do not publish the mod_rewrite apache module) it's not my fault.

You demonstrate an inordinate sense of entitlement to take my efforts to help people as responsibility for any technical inadequacy you might have when trying to take advantage of the code I publish.

Like I said earlier, if you are going to be rude and dislike that I wasn't online to help then feel free not to use the code I provide and I ask that you refrain from derailing a thread in which I am trying to help others with your tantrum.

I have no obligation to you and treating me rudely certainly isn't going to change that.
0 Replies
 
Exploitx
 
  1  
Reply Wed 23 Feb, 2005 07:09 pm
Craven I appreciate that you are helping me and many other people and this time i have this problem
I will show you the errors and the .htaccess:

Error:
Code:[Thu Feb 24 07:02:15 2005] [error] [client 195.238.57.119] File does not exist: /home/exploitx/public_html/forum-.html
[Thu Feb 24 07:01:10 2005] [error] [client 195.238.57.119] File does not exist: /home/exploitx/public_html/forum-.html
[Thu Feb 24 06:59:33 2005] [error] [client 159.134.157.171] File does not exist: /home/exploitx/public_html/forum/forum-.html
[Thu Feb 24 06:42:24 2005] [error] [client 195.238.57.119] File does not exist: /home/exploitx/public_html/forum/forum-38.html


.htaccess:
Code:RewriteEngine On
RewriteBase /
RewriteRule ^forums.* index.php [L,NC]
RewriteRule ^post-([0-9]*).html&highlight=([a-zA-Z0-9]*) post-.html$1&highlight=$2 [L,NC]
RewriteRule ^post-([0-9]*).* post-.html$1 [L,NC]
RewriteRule ^view-poll([0-9]*)-([0-9]*)-([a-zA-Z]*).* about.html$1&postdays=$2&postorder=$3&vote=viewresult [L,NC]
RewriteRule ^about([0-9]*).html&highlight=([a-zA-Z0-9]*) about.html$1&highlight=$2 [L,NC]
RewriteRule ^about([0-9]*).html&view=newest about.html$1&view=newest [L,NC]
RewriteRule ^about([0-9]*)-([0-9]*)-([a-zA-Z]*)-([0-9]*).* about.html$1&postdays=$2&postorder=$3&start=$4 [L,NC]
RewriteRule ^about([0-9]*)-([0-9]*).* about.html$1&start=$2 [L,NC]
RewriteRule ^about([0-9]*).* about.html$1 [L,NC]
RewriteRule ^about([0-9]*).html about.html$1&start=$2&postdays=$3&postorder=$4&highlight=$5 [L,NC]
RewriteRule ^mark-forum([0-9]*).html* forum-.html$1&mark=topics [L,NC]
RewriteRule ^updates-topic([0-9]*).html* about.html$1&watch=topic [L,NC]
RewriteRule ^stop-updates-topic([0-9]*).html* about.html$1&unwatch=topic [L,NC]
RewriteRule ^forum-([0-9]*).html forum-.html$1 [L,NC]
RewriteRule ^forum-([0-9]*).* forum-.html$1 [L,NC]
RewriteRule ^topic-([0-9]*)-([0-9]*)-([0-9]*).* forum-.html$1&topicdays=$2&start=$3 [L,NC]
RewriteRule ^ptopic([0-9]*).* about.html$1&view=previous [L,NC]
RewriteRule ^ntopic([0-9]*).* about.html$1&view=next [L,NC]

<Files 403.shtml>
order allow,deny
allow from all
</Files>




Please can you help me in this?

Sincerely
Carlos
0 Replies
 
fyseng
 
  1  
Reply Thu 12 May, 2005 09:14 pm
I did the test and it is not working on my server. Here the logs

[Thu May 12 23:07:31 2005] [error] [client xxx] File does not exist: /home/about/public_html/500.shtml
[Thu May 12 23:07:31 2005] [alert] [client xxx] /home/about/public_html/test/.htaccess: Invalid command '[*]Attempt', perhaps mis-spelled or defined by a module not included in the server configuration

Any idea? the mode_rewrite is loaded on my server.
0 Replies
 
Craven de Kere
 
  1  
Reply Fri 13 May, 2005 01:26 am
Exploitx wrote:
Craven I appreciate that you are helping me and many other people and this time i have this problem
I will show you the errors and the .htaccess:


Your rewrite rules are incorrect. Use the ones supplied. Yours differs from the ones supplied in critical ways.
0 Replies
 
sett
 
  1  
Reply Sat 30 Jul, 2005 06:32 pm
man you really rock with that thing!
thank you very much!
I had also lots of troubles but reading help helped me Smile
I also added
RewriteBase / forum/
to my .htaccess file to make it work, as otherwise it did not work.
Hope this tip will help someone Smile
0 Replies
 
webdesignlab
 
  1  
Reply Tue 6 Sep, 2005 10:23 am
Hi Craven,

I tried and tried with this thing. My host says that mod_rewrite is on. But my url whilst writing the .html part hasa an error

http://www.ilovehuatulco.com/huatulco/forum-2.html

Internal Server Error
 
File not found.

Ok my htaccess is

Code:
RewriteEngine On
RewriteBase /
RewriteRule ^forums.* index.php [L,NC]
RewriteRule ^post-([0-9]*).html&highlight=([a-zA-Z0-9]*) viewtopic.php?p=$1&highlight=$2 [L,NC]
RewriteRule ^post-([0-9]*).* viewtopic.php?p=$1 [L,NC]
RewriteRule ^view-poll([0-9]*)-([0-9]*)-([a-zA-Z]*).* viewtopic.php?t=$1&postdays=$2&postorder=$3&vote=viewresult [L,NC]
RewriteRule ^about([0-9]*).html&highlight=([a-zA-Z0-9]*) viewtopic.php?t=$1&highlight=$2 [L,NC]
RewriteRule ^about([0-9]*).html&view=newest viewtopic.php?t=$1&view=newest [L,NC]
RewriteRule ^about([0-9]*)-([0-9]*)-([a-zA-Z]*)-([0-9]*).* viewtopic.php?t=$1&postdays=$2&postorder=$3&start=$4 [L,NC]
RewriteRule ^about([0-9]*)-([0-9]*).* viewtopic.php?t=$1&start=$2 [L,NC]
RewriteRule ^about([0-9]*).* viewtopic.php?t=$1 [L,NC]
RewriteRule ^about([0-9]*).html viewtopic.php?t=$1&start=$2&postdays=$3&postorder=$4&highlight=$5 [L,NC]
RewriteRule ^mark-forum([0-9]*).html* viewforum.php?f=$1&mark=topics [L,NC]
RewriteRule ^updates-topic([0-9]*).html* viewtopic.php?t=$1&watch=topic [L,NC]
RewriteRule ^stop-updates-topic([0-9]*).html* viewtopic.php?t=$1&unwatch=topic [L,NC]
RewriteRule ^forum-([0-9]*).html viewforum.php?f=$1 [L,NC]
RewriteRule ^forum-([0-9]*).* viewforum.php?f=$1 [L,NC]
RewriteRule ^topic-([0-9]*)-([0-9]*)-([0-9]*).* viewforum.php?f=$1&topicdays=$2&start=$3 [L,NC]
RewriteRule ^ptopic([0-9]*).* viewtopic.php?t=$1&view=previous [L,NC]
RewriteRule ^ntopic([0-9]*).* viewtopic.php?t=$1&view=next [L,NC]


For info I am working on a mac with BBedit and Dreamweaver as my ftp

Any kind of insight would be great.

I am no great coder so be gentle with me.

Cheers

Kevin
0 Replies
 
Craven de Kere
 
  1  
Reply Tue 6 Sep, 2005 10:08 pm
Craven de Kere wrote:
As far as I remember, every single possible reason that my mod_rewrite can go wrong for you is listed here. I will start simply directing people here instead of repeating myself.


From the first post in this thread. The answers are there. Try them!
0 Replies
 
webdesignlab
 
  1  
Reply Fri 9 Sep, 2005 10:38 am
Sorry but stillhaving trouble, but to show that I am also a sharer and deseve a little help.

Here is a little mod that is dead easy to do to help SEO on PHPBB.

open templates/subSilver/overall_header.tpl

after <META http-equiv="Content-Style-Type" content="text/css" />

Add

<meta name="description" content="[PAGE_TITLE]">
<meta name="keywords" content="[PAGE_TITLE]">

Also change <title>{PAGE_TITLE}</title>

Also find <td><a href="index.php"><img src="templates/subSilver/images/logo_phpBB.gif" border="0" alt="" vspace="1" /></a></td>

Replace with <td><a href="index.php"><img src="templates/subSilver/images/logo_phpBB.gif" border="0" alt="[PAGE_TITLE]" vspace="1" /></a></td>


Now please help me Craven.

I am a novice to this stuff and I have asked my hosting co to help, but to no avail.

Cheers

Kevin
0 Replies
 
webdesignlab
 
  1  
Reply Sun 11 Sep, 2005 03:18 pm
Hi, My webhost asked me to add a $ after all * still did not work.


Code:
RewriteEngine on
RewriteBase /
RewriteCond %{HTTP_HOST} ^ilovehuatulco\.com
RewriteRule ^(.*)$ http://www.ilovehuatulco.com/$1 [R=permanent,L]
RewriteRule ^forums.*$ index.php [L,NC]
RewriteRule ^post-([0-9]*$).html&highlight=([a-zA-Z0-9]*) viewtopic.php?p=$1&highlight=$2 [L,NC]
RewriteRule ^post-([0-9]*$$).*$ viewtopic.php?p=$1 [L,NC]
RewriteRule ^view-poll([0-9]*$)-([0-9]*$)-([a-zA-Z]*$).*$ viewtopic.php?t=$1&postdays=$2&postorder=$3&vote=viewresult [L,NC]
RewriteRule ^about([0-9]*$).html&highlight=([a-zA-Z0-9]*$) viewtopic.php?t=$1&highlight=$2 [L,NC]
RewriteRule ^about([0-9]*$).html&view=newest viewtopic.php?t=$1&view=newest [L,NC]
RewriteRule ^about([0-9]*$)-([0-9]*$)-([a-zA-Z]*$)-([0-9]*$).*$ viewtopic.php?t=$1&postdays=$2&postorder=$3&start=$4 [L,NC]
RewriteRule ^about([0-9]*$)-([0-9]*$).*$ viewtopic.php?t=$1&start=$2 [L,NC]
RewriteRule ^about([0-9]*$).*$ viewtopic.php?t=$1 [L,NC]
RewriteRule ^about([0-9]*$).html viewtopic.php?t=$1&start=$2&postdays=$3&postorder=$4&highlight=$5 [L,NC]
RewriteRule ^mark-forum([0-9]*$).html*$ viewforum.php?f=$1&mark=topics [L,NC]
RewriteRule ^updates-topic([0-9]*$).html*$ viewtopic.php?t=$1&watch=topic [L,NC]
RewriteRule ^stop-updates-topic([0-9]*$).html*$ viewtopic.php?t=$1&unwatch=topic [L,NC]
RewriteRule ^forum-([0-9]*$).html viewforum.php?f=$1 [L,NC]
RewriteRule ^forum-([0-9]*$).*$ viewforum.php?f=$1 [L,NC]
RewriteRule ^topic-([0-9]*$)-([0-9]*$)-([0-9]*$).*$ viewforum.php?f=$1&topicdays=$2&start=$3 [L,NC]
RewriteRule ^ptopic([0-9]*$).*$ viewtopic.php?t=$1&view=previous [L,NC]
RewriteRule ^ntopic([0-9]*$).*$ viewtopic.php?t=$1&view=next [L,NC]


Any ideas or has my webhiost just not got mod_rewrite enabled even though they think it is?
0 Replies
 
Craven de Kere
 
  1  
Reply Mon 12 Sep, 2005 11:24 pm
webdesignlab wrote:
Now please help me Craven.


Please quote the issues that are listed in the first post and indicate how you ruled them out.

Merely doing so will probably give you your answer, and until then I can only guess at which of them describes your case. However if I were to guess, I would currently guess that you put your .htaccess file in the wrong location (the correct location is indicated in the mod and in the first post in this thread that I keep pointing you at).

If that's what it turns out to be then please at least understand my frustration with repeatedly pointing out answers to no avail.
0 Replies
 
 

Related Topics

 
  1. Forums
  2. » The definitive guide to phpBB mod_rewrite problems/errors
Copyright © 2019 MadLab, LLC :: Terms of Service :: Privacy Policy :: Page generated in 0.03 seconds on 06/17/2019 at 10:43:36