Forum Moderators: phranque
[webmasterworld.com...]
I have 2 WordPress instalations and some other rewrites that are pertinent to the top directory and not to WordPress instalations.
This goes into the root dir .htaccess
Options +FollowSymlinks
Rewriteengine on
RewriteCond %{REQUEST_URI}!^/blogtest(.*)$
# You will need to have this for every rule
blogtest dir .htaccess
<IfModule mod_rewrite.c>
Options +FollowSymlinks
Rewriteengine on
RewriteBase /blogtest/
RewriteCond %{REQUEST_FILENAME}!-f
RewriteCond %{REQUEST_FILENAME}!-d
RewriteRule . /blogtest/index.php [L]
</IfModule>
#End
Regards,
Igor
root .htaccess (Here you say rewrite all except blog and blogtest)
blog .htacess gets its own rewrite
blogtest .htaccess gets its own rewrite
http://www.example.com/blogtest/ server header 200 ok
RewriteCond %{REQUEST_URI}!^/blogtest(.*)$
RewriteRule ^(.*)\.jpg$ /images/$1\.jpg
So you still have the two WordPress directories, right?
But you want to rewrite the picture files that are phisically in the images dir to come like this.
http://www.example.com/image.jpg
This is a virtual rewrite so you get 200 ok.
The actual file is in the /images/
That is why you need the condition not to rewite your /blogtest/ otherwise the WordPress instalation rewrite will not work.
There are many reasons to have rewrites in the top dir and sub branches besides the WorPress dir.
Cononical duplication is a very important reason.
Remeber when you have the blog instaled in a sub directory, proper instalation, you still have to deal with home dir root! That is why the condition to exclude the WordPress dir, because of its rewrite!
[edited by: encyclo at 1:57 am (utc) on Dec. 23, 2007]
[edit reason] no links to personal sites please [/edit]
RewriteCond %{REQUEST_URI}!^/blogtest(.*)$ (this says exclude /blogtest dir)
# You will need to have this for every rule
Tell me if you have a spesific rewrite that you are interested in doing and I will try to help you hack it.
https to http
not www to www
mail sub domain to www
etc.