A
A
Albert Ushakov2019-10-18 16:00:56
Regular Expressions
Albert Ushakov, 2019-10-18 16:00:56

How to process links in htaccess if there are 2 getas?

How to configure second get requests via htaccess?
Here is the link before processing:
https://lastlegends.site/?page=register
Here is after processing:
https://lastlegends.site/register
RewriteRule ^([a-zA-Z0-9]+)$ ?page=$1
How to convert this link:
https://lastlegends.site/?page=register&referal=9
In :
https://lastlegends.site/register/referal9
and if you do this, will the styles not fly off?
Here on the page links to pages are processed in this way:

if(empty($_GET['page'])){
  $page = 'index';
}else{
  $page = preg_replace("/[^a-zA-Z0-9]/", "", $_GET['page']);
}
//И далее идет на получение файла страницы...

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alams Stoyne, 2019-10-18
@fuck_ask

RewriteEngine On
RewriteRule ^([a-zA-Z0-9]+)$ ?page=$1
RewriteRule ^([a-zA-Z0-9]+)/([a-zA-Z0-9]+)$ ? page=$1&referral=$2

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question