WordPress – how to overwrite Apache rewrite rules?

In my apache host setting, I have this by default,

    RewriteCond     %{DOCUMENT_ROOT}/%{REQUEST_FILENAME}    !-f
    RewriteCond     %{DOCUMENT_ROOT}/%{REQUEST_FILENAME}    !-d
    RewriteCond     %{REQUEST_URI}                          !^/server-status
    RewriteRule     ^/([a-zA-Z0-9_-]+)$           /app/os?site=$1 [R,QSA]

    RewriteCond     %{DOCUMENT_ROOT}/%{REQUEST_FILENAME}    !-f
    RewriteCond     %{DOCUMENT_ROOT}/%{REQUEST_FILENAME}    !-d
    RewriteRule     ^/([a-zA-Z0-9_-]+)/([a-zA-Z0-9_-]+)/?$      /app/os?site=$1&page=$2 [R,QSA]

How can I overwrite that with .htaccess for my WP site?

Read More

.htaccess

RewriteEngine On
RewriteBase /
RewriteRule ^index.php$ - [L]

# add a trailing slash to /wp-admin
RewriteRule ^([_0-9a-zA-Z-]+/)?wp-admin$ $1wp-admin/ [R=301,L]

RewriteCond %{REQUEST_FILENAME} -f [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^ - [L]
RewriteRule ^([_0-9a-zA-Z-]+/)?(wp-(content|admin|includes).*) $2 [L]
RewriteRule ^([_0-9a-zA-Z-]+/)?(.*.php)$ $2 [L]
RewriteRule . index.php [L]

Currently if I have this on my browser address bar:

http://wpxxx.com/app/about

it will be rewritten to:

http://wpxxx.com/app/os?site=about

if I use this:

http://wpxxx.com/app/about/

I will get this error:

Not Found

The requested URL /about/ was not found on this server.

Any ideas how I can fix this?

Related posts