R
R
romasovest2018-09-19 21:13:31
htaccess
romasovest, 2018-09-19 21:13:31

How to add a parameter to a request via htaccess?

How to make it so that when accessing .css, the GET parameter v=0.5 is added.
That is,
mysite/css/main.css
turns into
mysite/css/main.css? v=0.5
p/s: it is desirable that this change be visible in the address bar

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
Vladimir Letyagin, 2018-09-19
@romasovest

More or less like this

RewriteEngine On
RewriteRule ^/css/main\.css$ /css/main.css?v=0.5 [L]

Or so for all css files
RewriteEngine On
RewriteRule ^([a-z0-9]+\.css)$ /css/$1?v=0.5 [L]

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question