开发者

.htaccess file problems

开发者 https://www.devze.com 2023-04-10 00:18 出处:网络
So I have a Joomla instance which is sitting in my ROOT directory. I have a Wordpress Multi-site installation sitting in the subdirectory /blog.

So I have a Joomla instance which is sitting in my ROOT directory. I have a Wordpress Multi-site installation sitting in the subdirectory /blog.

It seems like the server is having a hard time finding or getting sites in the /blog directory. Seems like it gets to the main /blog page fine but if I want to go to /blog/{sitename}, sitename being an instance of the Wordpress Mulitsite, it has a hard time getting there. Probably complicating matters is that I have Fancy URLs on both the Joomla instance as well as the Wordpress Multisite instance.

Both .htaccess files for Joomla and Wordpress Multisite are from stock installs of their respective applications (I'm 99% sure).

I'm going to post them here and see if anyone can see possible conflicts in the .htaccess

Joomla .htaccess with core SEF

version $Id: htaccess.txt 21064 2011-04-03 22:12:19Z dextercowley $

RewriteEngine On
RewriteCond %{QUERY_STRING} mosConfig_[a-zA-Z_]{1,21}(=|\%3D) [OR]
RewriteCond %{QUERY_STRING} base64_encode[^(]*\([^)]*\) [OR]
RewriteCond %{QUERY_STRING} (<|%3C)([^s]*s)+cript.*(>|%3E) [NC,OR]
RewriteCond %{QUERY_STRING} GLOBALS(=|\[|\%[0-9A-Z]{0,2}) [OR]
RewriteCond %{QUERY_STRING} _REQUEST(=|\[|\%[0-9A-Z]{0,2})
RewriteRule .* index.php [F开发者_运维知识库]

RewriteBase /
RewriteCond %{REQUEST_URI} !^/index\.php
RewriteCond %{REQUEST_URI} (/[^.]*|\.(php|html?|feed|pdf|raw))$ [NC]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule .* index.php [L]

END Joomla .htaccess

Now I have added this to the Joomla .htaccess file in hopes that it would not use SEF on the /blog folder but it doesn't seem to work. I am trying to exclude the blog directory from the top level .htaccess and just let the /blog .htaccess take over control of that subdirectory.

#RewriteCond %{REQUEST_URI} ^/blog/.*$
#RewriteRule ^.*$ - [L]

And here is my Wordpress .htaccess

RewriteEngine On
RewriteBase /blog/
RewriteRule ^index\.php$ - [L]
RewriteRule ^([_0-9a-zA-Z-]+/)?files/(.+) wp-includes/ms-files.php?file=$2 [L]
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]

Everything on the top level domain (Joomla) runs very fast when pages are requested.

The server eventually finds the /blog directory but it takes more time than it should. The really big problem is that when i go to one of the blog sites (/blog/sitename) it can take upwards of 8-10 seconds. And then once the page loads and I go to another page on that /blog/sitename like "About" it can take about the same amount of time.

Overall very frustrating. Any help is appreciated. I've been googling for awhile and have not found much help besides

#RewriteCond %{REQUEST_URI} ^/blog/.*$
#RewriteRule ^.*$ - [L]

And it has not helped the problem.

It seems like all the sites in the /blog directory are very slow to get to. I have about 6 in there and they are all very slow loading.


Well, I'm not sure if you're developing locally but one thing you could try would be to place all the Joomla files in their own directory and use .htaccess to resolve the site correctly - then you shouldn't have the Joomla .htaccess affecting your /blog directory.

Just a consideration. I'm not sure that it would resolve the issue entirely but at least then you could separate out the issue of 'is the Joomla .htaccess conflicting with the Wordpress .htacceess and causing a slowdown'.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号