我试图让所有com_k2链接因为某种原因指向我的网站而被410(已消失),但是htaccess
的WordPress部分(我的意思是#BEGIN WordPress - #END WordPress )覆盖它,我无法使它工作。
这就是我在网站顶部的内容:
RewriteEngine On
RewriteBase /
RewriteCond %{HTTPS} =on
RewriteCond %{HTTP_HOST} ^www.mypage.com
RewriteCond %{QUERY_STRING} com_k2 [NC]
RewriteRule ^ - [G,L]
然后在底部WP使这个:
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
模式是:
https://www.mypage.com/?option=com_k2&view=itemlist&task=user&id=5640
我没有htaccess专家所以......帮助!
这是完整的htaccess:
# BEGIN WpFastestCache
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{HTTP_HOST} ^(www\.)?mitza\.es
RewriteCond %{QUERY_STRING} com_k2 [NC]
RewriteRule ^ - [G]
# Start WPFC Exclude
# End WPFC Exclude
# Start_WPFC_Exclude_Admin_Cookie
RewriteCond %{HTTP:Cookie} !wordpress_logged_in_[^\=]+\=mitza@mitza.es
# End_WPFC_Exclude_Admin_Cookie
RewriteCond %{HTTP_HOST} ^www.mitza.es
RewriteCond %{HTTP_USER_AGENT} !(facebookexternalhit|WhatsApp|Mediatoolkitbot)
RewriteCond %{REQUEST_METHOD} !POST
RewriteCond %{REQUEST_URI} !(\/){2}$
RewriteCond %{QUERY_STRING} !.+
RewriteCond %{HTTP:Cookie} !comment_author_
RewriteCond %{HTTP:Cookie} !wp_woocommerce_session
RewriteCond %{HTTP:Cookie} !safirmobilswitcher=mobil
RewriteCond %{HTTP:Profile} !^[a-z0-9\"]+ [NC]
RewriteCond %{DOCUMENT_ROOT}/wp-content/cache/all/$1/index.html -f [or]
RewriteCond /home/mitzaes/public_html/wp-content/cache/all/$1/index.html -f
RewriteRule ^(.*) "/wp-content/cache/all/$1/index.html" [L]
</IfModule>
<FilesMatch "index\.(html|htm)$">
AddDefaultCharset UTF-8
<ifModule mod_headers.c>
FileETag None
Header unset ETag
Header set Cache-Control "max-age=0, no-cache, no-store, must-revalidate"
Header set Pragma "no-cache"
Header set Expires "Mon, 29 Oct 1923 20:30:00 GMT"
</ifModule>
</FilesMatch>
# END WpFastestCache
# BEGIN GzipWpFastestCache
<IfModule mod_deflate.c>
AddType x-font/woff .woff
AddOutputFilterByType DEFLATE image/svg+xml
AddOutputFilterByType DEFLATE text/plain
AddOutputFilterByType DEFLATE text/html
AddOutputFilterByType DEFLATE text/xml
AddOutputFilterByType DEFLATE text/css
AddOutputFilterByType DEFLATE text/javascript
AddOutputFilterByType DEFLATE application/xml
AddOutputFilterByType DEFLATE application/xhtml+xml
AddOutputFilterByType DEFLATE application/rss+xml
AddOutputFilterByType DEFLATE application/javascript
AddOutputFilterByType DEFLATE application/x-javascript
AddOutputFilterByType DEFLATE application/x-font-ttf
AddOutputFilterByType DEFLATE application/vnd.ms-fontobject
AddOutputFilterByType DEFLATE font/opentype font/ttf font/eot font/otf
</IfModule>
# END GzipWpFastestCache
# BEGIN LBCWpFastestCache
<FilesMatch "\.(ico|pdf|flv|jpg|jpeg|png|gif|webp|js|css|swf|x-html|css|xml|js|woff|woff2|ttf|svg|eot)(\.gz)?$">
<IfModule mod_expires.c>
AddType application/font-woff2 .woff2
ExpiresActive On
ExpiresDefault A0
ExpiresByType image/webp A2592000
ExpiresByType image/gif A2592000
ExpiresByType image/png A2592000
ExpiresByType image/jpg A2592000
ExpiresByType image/jpeg A2592000
ExpiresByType image/ico A2592000
ExpiresByType image/svg+xml A2592000
ExpiresByType text/css A2592000
ExpiresByType text/javascript A2592000
ExpiresByType application/javascript A2592000
ExpiresByType application/x-javascript A2592000
ExpiresByType application/font-woff2 A2592000
</IfModule>
<IfModule mod_headers.c>
Header set Expires "max-age=2592000, public"
Header unset ETag
Header set Connection keep-alive
FileETag None
</IfModule>
</FilesMatch>
# END LBCWpFastestCache
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
# END WordPress
# BEGIN Brute Force Login Protection
<FilesMatch ".*\.(php|html?|css|js|jpe?g|png|gif)$">
order deny,allow
deny from 91.200.12.22
deny from 91.200.12.91
deny from 2607:f298:5:101b::61e:49ae
</FilesMatch>
# END Brute Force Login Protection
RewriteEngine on
Redirect 301 /nuevo-nicehash-miner-legacy https://www.mitza.es/noticias/nuevo-nicehash-miner-legacy
Redirect 301 /secciones/bitcoin/ https://www.mitza.es/zonas/paginas-web-valdemoro
Redirect 301 /secciones/litecoin/ https://www.mitza.es/zonas/paginas-web-valdemoro
Redirect 301 /portfolio/gibson-guitars/ https://www.mitza.es/zonas/paginas-web-valdemoro
Redirect 301 /portfolio/nex7-workspace/ https://www.mitza.es/zonas/paginas-web-valdemoro
Redirect 301 /how-videos-can-help-promote-your-business/ https://www.mitza.es/zonas/paginas-web-valdemoro
Redirect 301 /working-like-a-workaholic/ https://www.mitza.es/zonas/paginas-web-valdemoro
Redirect 301 /portfolio/focus-lab/ https://www.mitza.es/zonas/paginas-web-valdemoro
Redirect 301 /portfolio/outdoor-photoshoot/ https://www.mitza.es/zonas/paginas-web-valdemoro
Redirect 301 /portfolio/l-a-p-d-1947/ https://www.mitza.es/zonas/paginas-web-valdemoro
Redirect 301 /audio-post/ https://www.mitza.es/zonas/paginas-web-valdemoro
Redirect 301 /perfect-sunday-morning-ride/ https://www.mitza.es/zonas/paginas-web-valdemoro
Redirect 301 /secciones/noticias/ https://www.mitza.es/noticias
#2
Redirect 301 /logic-will-get-you-from-a-to-b/ https://www.mitza.es/
Redirect 301 /component/content/article/2-uncategorised/80-para-costi https://www.mitza.es
Redirect 301 /role-of-size-in-logo-design/ https://www.mitza.es/
Redirect 301 /portfolio/its-summer-time/ https://www.mitza.es/
Redirect 301 /portfolio/maybe-one-day-fashion/ https://www.mitza.es/
Redirect 301 /hello-world-2/ https://www.mitza.es/
Redirect 301 /hola-mundo/ https://www.mitza.es/
Redirect 301 /try-me https://www.mitza.es/
Redirect 301 /poze-cu-elsa https://www.mitza.es/
Redirect 301 /portfolio/sea-side-store/ https://www.mitza.es/
Redirect 301 /portfolio/time-is-nothing/ https://www.mitza.es/
Redirect 301 /category/noticias https://www.mitza.es/
# BEGIN WP Performance Score Booster Settings
# END WP Performance Score Booster Settings
Redirect 301 /case-study-envato-website-redesign/ https://www.mitza.es/
答案 0 :(得分:0)
@这一行:
RewriteCond %{HTTP_HOST} ^www.mypage.com
你应该像这样逃避空间角色:
RewriteCond %{HTTP_HOST} ^www\.mypage\.com
如果您想要同时匹配www
或non-www
替换:
RewriteCond %{HTTP_HOST} ^(www\.)?mypage\.com