0

The query string of my webpage looks like this and this shows in the urls now.

board_list.php?ptype=list&code=Breaking_News&idx=5752&page=1

It is really messy, so I've been looking for ways to make them look simpler. So I ended up with creating .htaccess file and uploaded it to root folder of my website where board_list.php is.

RewriteEngine On

RewriteCond %{DOCUMENT_ROOT}%{REQUEST_URI}.php -f
RewriteRule ^(.*)$ $1.php [L]

RewriteRule ^board/([a-z0-9\-]+)/([a-z0-9\-]+)/([a-z0-9\-]+)/([a-z0-9\-]+)$ board_list.php?ptype=$1&code=$2&idx=$3&page=$4 [L]

Could someone tell me what's wrong with my urls? Thanks in advance :) Have a nice day.

Visualizer7
  • 325
  • 1
  • 5
  • 13
  • `Could someone tell me what's wrong with my urls` : could you tell us what's wrong for you, effects, logs? – regilero Nov 01 '11 at 14:28

1 Answers1

0

Do you know what the second and third line do? For me it's not really clear?

Have you tried only adding the last rule, and see what happens then? You could also try to "debug" your .htaccess on this website: http://htaccess.madewithlove.be/ Although, probably, it won't be able to process those %{DOCUMENT_ROOT} and %{REQUEST_URI} variables.

Or you could create a debug.php, with only a var_dump($_SERVER); and var_dump($_REQUEST);. Redirect the RewriteRule to this script rather than the board_list.php and view the values passed to this script.

(And I think you should set the RewriteRule ^board/.. rule before the RewriteCond %{DOC... rule.)

Grad van Horck
  • 4,488
  • 1
  • 21
  • 22