R
R
romanchi2015-05-21 17:46:04
Apache HTTP Server
romanchi, 2015-05-21 17:46:04

How to make a url like /article_name/page/?

There is a .htaccess file, redirects are configured in it.
To convert example.com/username?page=2 to example.com/profile.php?login=username&page=2 I use this rule:

RewriteRule ^([a-zA-Z0-9-]+)?page=([0-9]+)$ profile.php?login=$1&page=$2

But it doesn't work. What's wrong?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
ShamblerR, 2015-05-22
@romanchi

Since when did GET become part of the url for mod_rewrite ?
# 301 --- test.ru/text/faq.html?faq=20 => test.ru/helpdesk/kb.php

RewriteCond %{QUERY_STRING} (^|&)faq=20($|&)
RewriteRule ^text/faq\.html$ /helpdesk/kb.php? [L,R=301]

Rewrite --- test.ru/text/faq.html?faq=20 => test.ru/helpdesk/kb.php
RewriteCond %{QUERY_STRING} (^|&)faq=20($|&)
RewriteRule ^text/faq\.html$ /helpdesk/kb.php?&%{QUERY_STRING}

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question