1

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?

.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?

Run
  • 54,938
  • 169
  • 450
  • 748

1 Answers1

1

I found these link's

https://www.reddit.com/r/Wordpress/comments/2r4lfa/whats_the_root_cause_of_htaccess_overwrites/

override apache rewrite rules with htaccess

I hope you will get a solution.

Community
  • 1
  • 1
Husain Ahmmed
  • 351
  • 2
  • 7