How to rename the url of each page in the address bar?

Hello guys let me try to explain what I'm trying to do. My web site has a few pages and it is hosted Apache via Aruba

My question for you is, can I rename them in a simple way like --->
               /site/page1.php --->
               /site/page2.php --->
               /site/page2.php?action=someaction=12345 --->

I've read online about .htaccess but I have no clue how to set it up, can someone explain it to me? Thank you

1 answer

  • answered 2018-11-07 19:07 Mehran

    I think it`s like this:

      RewriteEngine On
        RewriteCond %{REQUEST_FILENAME} !-f
        RewriteCond %{REQUEST_FILENAME} !-d
        RewriteRule ^ ?$
        RewriteRule ^[0-9]+)/$1
        RewriteRule ^[0-9]+) /?action=$1&%{QUERY_STRING} [L]