1

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

www.website.com/site/index.php
               /site/page1.php
               /site/page2.php
               /site/page2.php?action=someaction=12345

My question for you is, can I rename them in a simple way like

www.website.com/site/index.php ---> www.website.com
               /site/page1.php ---> www.website.com/page1
               /site/page2.php ---> www.website.com/page2
               /site/page2.php?action=someaction=12345 ---> www.website.com/page2

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

Fabzheimer
  • 45
  • 5
  • Possible duplicate of [How to write htaccess rewrite rule for seo friendly url](https://stackoverflow.com/questions/28168375/how-to-write-htaccess-rewrite-rule-for-seo-friendly-url) – Cedric Ipkiss Nov 07 '18 at 18:27

1 Answers1

0

I think it`s like this:

  RewriteEngine On

    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d

    RewriteRule ^website.com/site/index ?$ website.com
    RewriteRule ^website.com/page([0-9]+)/ website.com/site/page=$1
    RewriteRule ^website.com/site/page([0-9]+) /?action=$1&%{QUERY_STRING} [L] 
Mehran
  • 282
  • 1
  • 6
  • 17
  • I appreciate the help but can you explain it to me why is that the way it is? Can I manage the various action that occur in a page in a general way? like: RewriteRule ^website.com/site/page2?action={any function}={anyvalue} ?$ website.com/page2 – Fabzheimer Nov 07 '18 at 23:36