V
V
Viktor Korzunin2013-06-19 18:02:12
PHP
Viktor Korzunin, 2013-06-19 18:02:12

What am I doing wrong with url replacement in .htaccess?

Help, I've been trying to figure out how to organize a URL replacement for a day now:

Options +FollowSymlinks
RewriteEngine On

RewriteRule ^(.*)/(.*)$ $1/index.php?page=$2 [R=301,L]

I drive in site.ru/main - it says "The requested URL /main was not found on this server."
What am I doing wrong?

Answer the question

In order to leave comments, you need to log in

3 answer(s)
J
Jonh Doe, 2013-06-19
@CodeByZen

RewriteRule ^([^/]*)\$ /index.php?page=$1 [L]
and here you can practice.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question