2
   

The definitive guide to phpBB mod_rewrite problems/errors

 
 
webdesignlab
 
  1  
Reply Tue 13 Sep, 2005 09:25 am
Hi Craven,

Thanks for getting back to me.

my php info;

........................................

PHP Version 4.3.6

System FreeBSD iwojima.globat.com 4.9-RELEASE-p2 FreeBSD 4.9-RELEASE-p2 #4: Thu i386

........................................

My .htaccess is in the same folder as the phpbb forum called /huatulco

It seems to be working in one sense that its IS rewriting the URL just not displaying it. So does that mean a .htaccess problem or that I copied and pasted that mod for the includes/ incorrectly?

Cheers

Webdesignlab
0 Replies
 
Craven de Kere
 
  1  
Reply Tue 13 Sep, 2005 04:14 pm
Re: The definitive guide to phpBB mod_rewrite problems/error
Dude, how can I help you if you simply ignore what I write? I asked you to indicate whether you have performed the tests in the first post so that we can start from there.

What do you do? You ignore that request and do what the first post tells you not to do (see below, I am quoting it to see if that helps you try it).

Craven de Kere in the first post wrote:


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....


See the first post for the way to test mod_rewrite.

Please also see the first post for ways to fix your problem. If you don't tell me the results of each test, then I won't waste time trying to help only to be ignored repeatedly.
0 Replies
 
webdesignlab
 
  1  
Reply Thu 15 Sep, 2005 11:05 am
Oh I give up.

Honestly I am not mad or anything, it's obvious I dont have the skills needed to do this ... that's all.

I'll just do a few easy changes and foprget this bit ... pity though LOL.

Anyone send me a PM if you can help me?

Thanks for the help

Webdesignlab
0 Replies
 
Craven de Kere
 
  1  
Reply Thu 15 Sep, 2005 11:19 pm
You can do this, mate. I guarantee it.

Here's the first test (slightly edited to clarify a bit) from the first post. It's very simple:

Quote:
  • Make a directory on your site.
  • Make a file called bar.html in this directory with the following text "Happy happy joy joy".
  • Make an .htaccess file with the following and place it in the same directory
    [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.
0 Replies
 
webdesignlab
 
  1  
Reply Fri 16 Sep, 2005 09:23 am
Hi there,

I must be a gluton for punishment, but I tried a rewrite and it kinda worked.

Code:RewriteEngine On
RewriteRule !^test - [C]
RewriteRule ^.*$ /test/index.html [R,L]


This was a linked to http://www.ilovehuatulco.com/huatulco/test/anything.html
Which then redirects to http://www.ilovehuatulco.com/test/index.html.

Ok this is not what I wanted ... but it does show that rewrite is enabled.

What am I missing to make the redirect go to http://www.ilovehuatulco.com/huatulco/test/index.html? This may help to solve why the http://www.able2know mod is not working properly on (my server).


Thanks for the encouragement.

Kevin
0 Replies
 
Craven de Kere
 
  1  
Reply Sun 18 Sep, 2005 05:01 pm
You gave it a path from root, if you had left out the /test/ part it would work as you expect.
0 Replies
 
webdesignlab
 
  1  
Reply Mon 19 Sep, 2005 09:28 am
Now I cant see my site at all, just a directory listing ... hmmm?

So what do we know now? (or more to the point, what do YOU know now?, since I am a beginer). What does this all mean related tol the mod_rewrite for urls?

Code:RewriteEngine On
RewriteRule ^huatulco.*$ 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]


Is what I have at the moment.
0 Replies
 
Craven de Kere
 
  1  
Reply Mon 19 Sep, 2005 10:41 pm
It's hard to tell, your rule is odd (it would really help if you used the one I posted) and I'd need to ask a bunch of questions to understand what you are doing.

Try this, remove the first line of your rules and put the rest in a file named ".htaccess" and put it in your forum's directory. Then try to access http://yourdomain.com/yourfourm/ while logged out and report what happens when you browse topics.
0 Replies
 
webdesignlab
 
  1  
Reply Mon 26 Sep, 2005 02:20 pm
Hi,

Nothing new happened, error 404 etc.

Code:RewriteRule ^huatulco.*$ index.php [L,NC]
seems to be the problem area. my folder is named "huatulco" so what do I put in this line exactly?

My host advised me to put "$" after every "*" and then told me there was no third party script support ... I can delete them if you like.

Sorry to be so useless at this ...see this as a challenge.

Cheers
0 Replies
 
Craven de Kere
 
  1  
Reply Tue 27 Sep, 2005 09:03 pm
Remove that line, it's not necessary.

Did you put the .htaccess file in your FORUM directory?

If so, please look in your error log and tell us where the error request is going to.
0 Replies
 
webdesignlab
 
  1  
Reply Sat 1 Oct, 2005 02:24 pm
Code:68.142.249.42 iwojima.globat.com - [21/Sep/2005:22:21:23 -0700] "GET /huatulco/forum-2.html HTTP/1.0" 404 206 "-" "Mozilla/5.0 (compatible; Yahoo! Slurp; http://help.yahoo.com/help/us/ysearch/slurp)"


I have no idea what this means.

Cheers
0 Replies
 
webdesignlab
 
  1  
Reply Mon 17 Oct, 2005 04:20 pm
Well I finally got it to work, wowee.

With a lot of help from 'Nintendo' at http://forums.digitalpoint.com I put the .htaccess in my root folder, changed the ^ to / and got this

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


Thanks for putting up with me and also for your php scripts.

Cheers

Kevin
0 Replies
 
Slashdot
 
  1  
Reply Sat 24 Dec, 2005 11:45 pm
Hello Sir.
i am a bit confused.
i did the following-

1. created the file bar.htm
2. put it in a test dir
3. created a .htaccess file with these:

Quote:
RewriteEngine On
RewriteRule ^foo.* bar.html [L,NC]
[*]Attempt to access foo.html in this directory with your browser.


4. put it in the test folder.
5. got a 505 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.


6. contacted my hostgator and asked them for the mod_rewrite mod to be turned on. they replied:
Quote:
Mod_rewrite is already activated on all the domains.


and i cant deny that because the mod _rewrite works perfectly at this zencart
www.clanthemes.biz/shop
what do i do now sir?
sorry if i bothering alot.
i apprciate the help.
0 Replies
 
Slashdot
 
  1  
Reply Sun 25 Dec, 2005 02:03 am
ok sir.
everything is working now as it should except one thing.

For guests the links are now static URL's.

http://www........../board/forum-1.html

But links dont exist somehow? take me to an error page?

Thank you for the mod.
i will appreciate a reponse.
Happy holidays!
0 Replies
 
Craven de Kere
 
  1  
Reply Wed 28 Dec, 2005 12:59 am
If you post the error log for those hits I may be able to tell you more.
0 Replies
 
svickram
 
  1  
Reply Sun 29 Jan, 2006 09:05 am
Thanks a ton Chief. I used your mod and despite having 0 knowledge of programming, i was able to successfully apply the mod.

However I cant see no of users online and that is only visible in admin mode, can i modify tht as users find that sticky.

Second issue is about having title of last post on index page. I want to display link of last post on index page. from where i can get mod for that.

Once again thanks a lot for making such a wonderful mod.
0 Replies
 
mrcolj
 
  1  
Reply Fri 3 Feb, 2006 11:39 pm
Craven (or anyone else who wants to help to give Craven a break...),

I'm failing test #1. Foo.html is giving me a 404, and bar.html works fine. I'm getting no error messages, which may just mean I'm not verbose enough, I don't know. I checked my access log, which gives me:
Code:127.0.0.1 - - [03/Feb/2006:22:24:50 -0700] "GET /phpBB2/foo.html HTTP/1.1" 404 311 "-" "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.2; SV1; .NET CLR 1.1.4322)"


That all looks fine, but I don't know what else to cut and paste to you. So I could get at the logs without them being "in use by another application" (since I'm on Server 2003), I shut down the server before and after I opened the log. So you can see below the surrounding lines from my error.log, where it shows me starting and shows me stopping, but nothing in the 10 seconds I went and loaded Foo.html (as evidenced above.)
Code:[Fri Feb 03 22:24:31 2006] [notice] Child 3912: Starting 50 worker threads.
[Fri Feb 03 22:24:56 2006] [notice] Parent: Received shutdown signal -- Shutting down the server.


Sorry to be stuck and have to invoke you... Thanks for all your help.
0 Replies
 
Craven de Kere
 
  1  
Reply Sat 4 Feb, 2006 03:23 am
"Server 2003"? If it's windows and IIS it won't work natively. mod_rewrite is an Apache module and you may need to use something like ISAPI_Rewrite (http://www.isapirewrite.com/).

Note that my rewrite rules are written for mod_rewrite and I have no idea how they would work for you with such a "plugin" (there are others, search for "mod_rewrite for IIS" or somesuch). Either way, you can achieve the result if you can find a suitable URL rewriting engine and can contruct rules that work with it.
0 Replies
 
mrcolj
 
  1  
Reply Sat 4 Feb, 2006 09:11 am
I'm sorry, I should have been more explicit. I'm using WAMP (Windows Server 2003, Apache 2.0.55, MySQL 5, PHP 5.1.2). My point was, as far as I'm aware, because of threads and stuff, you can't open any file that's in use on windows, so I wasn't able to open the log without pausing apache. That's why you see the "starting threads" and "received shutdown signal" on either side of where I figured the 404 error should have registered.

So I'm using mod_rewrite on my gallery installation, and that's working fine; but something's magically amiss here... Okay, I just put the foo-->bar line into the .htaccess of my gallery folder, and it redirected fine. So it's the same line, different folder, and it worked.
0 Replies
 
mrcolj
 
  1  
Reply Sun 5 Feb, 2006 08:31 am
Solved it! It turned out, and again I'm new so I didn't know to look for this, it turned out in my httpd.conf overrides were only allowed in the gallery folder, so it was ignoring all other .htaccess files. Thanks everyone.
0 Replies
 
 

Related Topics

 
Copyright © 2024 MadLab, LLC :: Terms of Service :: Privacy Policy :: Page generated in 0.05 seconds on 11/14/2024 at 09:52:59