caterham, help me please

Discuss practical ways rearrange URLs using mod_rewrite.

caterham, help me please

Postby abud » Wed Apr 06, 2005 3:16 am

I got a code for search engine friendly url, but I had a problem when I run it.

When I click a forum then "http 404 not found" the requesting url http://www.m-benzforum.com/forum1.html not found in this server.

I found this code at http://www.phpbb.com/phpBB/viewtopic.php?p=645170
Author : rasputinj (he has a web forum that use this code). http://rasputinj.com/forum2/


Please check it out.
Why it is couldn't run on my forum?
I have ask to my host, he support mod_rewrite.
could you help me please, to resolve a problem on my forum?
give me any advice?

Thank you caterham
Abud
abud
 
Posts: 6
Joined: Mon Apr 04, 2005 12:07 am
Location: jakarta

Postby Caterham » Wed Apr 06, 2005 2:21 pm

and how does your .htaccess file look like now?
Caterham
 
Posts: 690
Joined: Fri Dec 10, 2004 1:30 pm

Postby abud » Thu Apr 07, 2005 12:13 am

caterham, sorry my english is not good.
I follow that code

This is my .htacces code:

DirectoryIndex index.php index.cgi index.pl index.shtml index.html

<Limit GET PUT POST>
order allow,deny
deny from 80.179.128.
deny from 64.140.49.
deny from 200.
allow from all
</Limit>

# deny most common except .php
<FilesMatch "\.
(inc|tpl|h|ihtml|sql|ini|conf|class|bin|spd|theme|module|exe)
$">

deny from all
</FilesMatch>

#Disable .htaccess viewing from browser
<Files ~ "^\.ht">
Order allow,deny   
Deny from all    
Satisfy All
</Files>

<Files ~ "\config.php$">
deny from all
</Files>

ErrorDocument 404 /error.php
RewriteEngine On
RewriteRule ^index.html index.php

#Forums
#Forums
RewriteRule ^viewforum.* viewforum.php
RewriteRule ^viewtopic.* viewtopic.php
RewriteRule ^forum([0-9]*).* viewforum.html?f=$1
RewriteRule ^ptopic([0-9]*).* viewtopic.html?t=$1


What do you think?
there something must changed by me?

I just edit 3 file (.htacces, includes/page header, includes/page tail).
When I test this code, all forum looked good. I get Url www.m-benzforum.com/forum1.html but I had a problem when I click view forum and view topic (http 404 not found).
I think there a problem on .htacces, could you help to correct my .htacces?

caterham thank you very much

Best regards,
Abud
abud
 
Posts: 6
Joined: Mon Apr 04, 2005 12:07 am
Location: jakarta

Postby Caterham » Thu Apr 07, 2005 1:19 pm

it looks correct

Just optimized:
Code: Select all
RewriteEngine On
RewriteRule ^index\.html index.php [L]

RewriteRule ^forum([0-9]+)\.html$ viewforum.html?f=$1 [QSA,L]
RewriteRule ^ptopic([0-9]+)\.html$ viewtopic.html?t=$1 [QSA,L]


But mod_rewrite is working on your server?
Try
Code: Select all
RewriteEngine On
RewriteRule .* http://www.google.com [R,L]
you should see google.com for every request

(only one RewriteEngine On per .htaccess)
Caterham
 
Posts: 690
Joined: Fri Dec 10, 2004 1:30 pm

Postby abud » Thu Apr 07, 2005 5:48 pm

ok. first,To test, is mod_rewrite working on my server?

I will use
RewriteEngine On
RewriteRule .* http://www.google.com [R,L]



I think,maybe I incorrect in placed my .htacces.
and i want to ask, Where do I keep my .htacces on my server to run it?
could you tell me please? (on www?)

thank you.


Abud
abud
 
Posts: 6
Joined: Mon Apr 04, 2005 12:07 am
Location: jakarta


Return to Friendly URLs with Mod_Rewrite

Who is online

Users browsing this forum: No registered users and 26 guests

cron