I want to do this
website.com/blog/index.php -> website.com/blog
website.com/admin/archief_login.php -> website.com/admin
this works with my code.
but I want to add this:
website.com/aa -> website.com/web/index.php?init=aa
for some reason the blog gets this redirect: website.com/blog/?init=blog
what is the best way to set these different rewrites?
RewriteEngine on Options All -Indexes
RewriteCond %{HTTP_HOST}
^websit.com$ [OR] RewriteCond
%{HTTP_HOST} ^www.website.com$
RewriteRule ^admin$
“http\:\/\/www.website.com\/admin/archief_login.php”
[R=301,L]RewriteRule ^blog$
“http\:\/\/www.website.com\/blog/index.php”
[R=301,L]DirectoryIndex client_login.php
RewriteRule
^screen-([a-zA-Z0-9_-]+).html$
index_client.php?screen=$1RewriteRule
^invoice([a-zA-Z0-9_-]+).html$
make_invoice.php?id=$1RewriteRule
^pack-([a-zA-Z0-9_-]+).html$
index_client.php?screen=pack_code&wwwcode=$1
You need to put the more “general” rules lower in the file so they don’t match almost all of your URLs
The above will do
If you reverse the two rules you will get