S
S
Spark1082016-02-11 13:41:45
htaccess
Spark108, 2016-02-11 13:41:45

How to write a RewriteRule?

There is such a CNC code.

RewriteRule ^uid(.*)$ /index.php?uid=$1 [L,QSA]
RewriteRule ^(.*)$ /index.php?uname=$1 [L,QSA]

How to make it so that if there is a uid in the url, then use line 1, if not, then line 2?
And in general, what is the best way to process it through php or make a rule in htaccess? I am for htaccess.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Sergey Zelensky, 2016-02-11
@spark108

Routing is better to implement in php, there is such a thing as one entry point to applications, read for it, why shouldn't you do routing on htaccess? Because it is less flexible than php routing.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question