I want to insert a WordPress blog in a website which is programmed in PHP and that uses includes() to select what content to show, and that uses .htaccess Rewrite Rule to get friendly URLs.
The problem is that when installing WordPress in a subdirectory the rewriteRule executes and doesn't let the user get to the subdirectory where WordPress is located.
One way to solve this could be trying to program the includes to include all the WordPress content, but I think it would be quite difficult (wouldn't it?). Advantage: CSS style preserved!
The other solution I thought about was disabling the Rewrite Rule for the WordPress subdirectory (is it possible? How can it be done?). Disadvantage: CSS nod preserved, should be reinserted modifying WordPress files.
The third way I see is to install WordPress in a subdirectory, although I don't want to use this due to SEO optimization.
.htaccess file:
\# Activar RewriteEngine
RewriteEngine on
\# When only 1 var is set in the url
RewriteRule ^([a-zA-Z0-9\-]+)/?$ index.php?lang=$1
\# When 2 vars are set in the url
RewriteRule ^([a-zA-Z0-9\-]+)/([a-zA-Z0-9\-]+)?$ index.php?lang=$1&link0=$2
\# When 3 vars are set in the url
RewriteRule ^([a-zA-Z0-9\-]+)/([a-zA-Z0-9\-]+)/([a-zA-Z0-9\-]+)/?$ index.php?lang=$1&link0=$2&link1=$3
\# When 4 vars are set in the url
RewriteRule ^([a-zA-Z0-9\-]+)/([a-zA-Z0-9\-]+)/([a-zA-Z0-9\-]+)/([a-zA-Z0-9\-]+)/?$ index.php?lang=$1&link0=$2&link1=$3&link2=$4
\# When 5 vars are set in the url
RewriteRule ^([a-zA-Z0-9\-]+)/([a-zA-Z0-9\-]+)/([a-zA-Z0-9\-]+)/([a-zA-Z0-9\-]+)/([a-zA-Z0-9\-]+)/?$ index.php?lang=$1&link0=$2&link1=$3&link2=$4&link3=$5