0

My .htaccess is as below, and I need example.com/updatetagsyncronize.html/1/2

RewriteEngine On
RewriteBase /
RewriteRule ^(.*)$ index.php?q=$1 [L,QSA]

example.com/updatetagsyncronize.html - it works like this

And i need

example.com/updatetagsyncronize.html/1/2 - with two extra parameters

I found how to simplify and use with multiple parameters here simplified htaccess

But it is not working

 RewriteRule ^([-\w]+)?/?([-\w]+)?/?([-\w]+)?/?$ index.php?q=$1&seg2=$2&seg3=$3

What is the meaning of this (.*) and ([-\w]+) How can i rewrite this, combine first, because i am using cms modx, and maybe that why i am facing errors. Any advice or links. Thanks!!!

Asylzat
  • 197
  • 5
  • 17

2 Answers2

1

Well, if you make your document "updatetagsyncronize.html" a container (just "updatetagsyncronize") by checking corresponding checkbox in document's settings pane, here is the regexp that matches your string:

^([-\w\.]+)?\/?([-\w]+)?\/?([-\w]+)?\/?([-\w]+)?\/?$
// example.com/updatetagsyncronize/1/2/ or example.com/updatetagsyncronize/1/2

Also you need to enable friendly URLs in modx system settings. Or

^([-\w\.]+)?\/?([-\w\.]+)?\/?([-\w]+)?\/?([-\w]+)?\/?$

if you stick with ".html"

curveball
  • 4,320
  • 15
  • 39
  • 49
  • 1
    Good. Also make sure that other pages work too and pay attention to the answer to this question: https://stackoverflow.com/questions/14786340/rewrite-url-with-htaccess-for-multiple-parameters You might need to set that rewrite rule separately to handle your specific requests (.../1/2/ part) – curveball May 26 '17 at 12:16
0

Please take a look at the CustomRequest extra, if you are using MODX Revolution. Available in the extras repository.

Jako
  • 832
  • 5
  • 11