-1

Good morning,

I am building a new website and i would like to make the urls SEO friendly. The folder structure is as follow:

/index.php                           <-- first page
/frame.php                           <-- page wrapper which includes all the modules
/modules                             <-- All the modules
/modules/en/module-name/index.php
/modules/en/module-name/page2.php
/modules/en/module-name/page3.php
/modules/en/module-name-2/index.php
...

How can i make a .htaccess mod rewrite that allows me to visit the next urls to go to the pages above, and keep the structure the same for new urls?

So i would like to go to:

http://www.url.com/en/module-name/         ===   http://www.url.com/frame.php?page=en/module-name/index.php
or
http://www.url.com/en/module-name/page3    ===   http://www.url.com/frame.php?page=en/module-name/page3.php
etc

I have multiple domain LTD's so i prefer to not include the domain name Is this possible?

Thanks for everyones help!

BLB
  • 23
  • 1
  • 6
  • I tried this but it gives me an error 500 and i have no experience what so ever on this: `code` RewriteEngine On RewriteBase / RewriteCond %{REQUEST_URI} !^/frame RewriteRule (.*)/frame.php?&page_id=$1 `code` – BLB Jan 23 '20 at 10:43

1 Answers1

0

If you want to make your urls SEO friendly (and also don't want your urls to look like they come from the 2000s) you could use NGINX. Maybe this will help:

Rewrite all requests to index.php with nginx

Tim Rasim
  • 655
  • 7
  • 20
  • Maybe i am not understanding this correctly but on my previous server i used nginx and i wasn't able to do this because it only would work with apache, on the new server i (think) i am not using ngix but i am using apache. This should also be possible right? – BLB Jan 23 '20 at 12:13
  • NGINX is a reverse proxy, you can use it with the http-server of your choice. In this case you would only use it to provide url paths to the outside. There are many tutorials, just google it with your specific infrastructure and you will find a tutorial. – Tim Rasim Jan 23 '20 at 14:16