If you set the redirect setting, the absolute path will be displayed.

Asked 2 years ago, Updated 2 years ago, 142 views

Due to the URL error, we installed 301 redirect as below.
However, the redirect destination becomes an absolute path and cannot be accessed successfully.

RewriteEngine On
RewriteRule^gallery/design/bellipaint-design-([0-9]{3})/$ 
gallery/design/bellypaint-design-$1/[R=301,L]

https://www.heartkoru.com/home/heartkoru/heartkoru.com/public_html/gallery/design/bellypaint-design-001/

Originally, it should be as follows.
https://www.heartkoru.com/gallery/design/bellypaint-design-001/

If anyone knows how to solve this problem, please let me know.

The full description is as follows.

Options + FollowSymlinks
AddDefaultCharsetutf-8

# Normalized with www
RewriteEngine on
RewriteCond%{HTTP_HOST}^(heartkoru\.com)(:80)?[NC]
RewriteRule^(.*)https://www.heartkoru.com/$1 [R=301,L]

# Normalized without index.html
RewriteEngine on
RewriteCond%{THE_REQUEST}^.*/index.html
RewriteRule^(.*)index.html$https://www.heartkoru.com/$1 [R=301,L]

# SSL Redirect
RewriteEngine on
RewriteCond%{HTTPS} off
RewriteRule^(.*)$https://%{HTTP_HOST}%{REQUEST_URI}[R=301,L]

#Guidance to page
ErrorDocument 404/404.html

RewriteEngine On
RewriteCond%{QUERY_STRING} lightbox=
RewriteRule^/gallery/? [R=301,L]

RewriteEngine On
RewriteRule^gallery/design/bellipaint-design-([0-9]{3})/$gallery/design/bellypaint-design-$1/[R=301,L]

# 301 pages per page 301
Redirect permanent / print https://www.heartkoru.com/bellypaint-menu/princess/
Redirect permanent / babyphoto-1 https://www.heartkoru.com/mother/baby-photo/
Redirect permanent/materialitypaint-design?lightbox=image_1ssd https://www.heartkoru.com/gallery/
Redirect permanent/materiality-photo https://www.heartkoru.com/bellypaint-menu/maternity-photo/
Redirect permanent/bellypaint https://www.heartkoru.com/bellypaint-menu/
Redirect permanent/materialitypaint-design https://www.heartkoru.com/gallery/
Redirect permanent/aboutus https://www.heartkoru.com/about/
Redirect permanent / babyphoto https://www.heartkoru.com/mother/breastfeeding/
Redirect permanent/bellypaint-memo https://www.heartkoru.com/about/
Redirect permanent/blank https://www.heartkoru.com/copyright/
Redirect permanent/blank-1 https://www.heartkoru.com/gift/
Redirect permanent/maori https://www.heartkoru.com/bellypaint-menu/maori/
Redirect permanent/staff https://www.heartkoru.com/about/
Redirect permanent/menu3 https://www.heartkoru.com/faq/
Redirect permanent/menu1 https://www.heartkoru.com/about/
Redirect permanent/company https://www.heartkoru.com/about/
Redirect permanent/staff-1 https://www.heartkoru.com/about/
Redirect permanent/materialitypaint-design https://www.heartkoru.com/gallery/
Redirect permanent/petit-flower https://www.heartkoru.com/bellypaint-menu/petit-flower/
Redirect permanent/originalgoods https://www.heartkoru.com/gift/
Redirect permanent / trial https://www.heartkoru.com/bellypaint-menu/trial/
Redirect permanent/decoart https://www.heartkoru.com/bellypaint-menu/
Redirect permanent /#!bellypaint-menu / https://www.heartkoru.com/bellypaint-menu/
Redirect permanent/gallery/?lightbox=dataItem-j2qspwgr https://www.heartkoru.com/gallery/
Redirect permanent/gallery/?lightbox=dataItem-it14z4i8 https://www.heartkoru.com/gallery/

#gzip compression
<IfModule mod_deflate.c>
SetOutputFilter DEFLATE
BrowserMatch^Mozilla/4gzip-only-text/html
BrowserMatch^Mozilla/4\.0 [678] no-gzip
BrowserMatch\bMSI[E]!no-gzip!gzip-only-text/html
SetEnvIfNoCase Request_URI\.(?:gif|jpe?g|png|ico)$no-gzip dont-vary
SetEnvIfNoCase Request_URI_\.utxt$no-gzip
#DeflateCompressionLevel 4
AddOutputFilterByType DEFLATE text/plain
AddOutputFilterByType DEFLATE text/html
AddOutputFilterByType DEFLATE text/xml
AddOutputFilterByType DEFLATE text/css
AddOutputFilterByType DEFLATE application/xhtml+xml
AddOutputFilterByType DEFLATE application/xml
AddOutputFilterByType DEFLATE application/rss+xml
AddOutputFilterByType DEFLATE application/atom_xml
AddOutputFilterByType DEFLATE application/javascript
AddOutputFilterByType DEFLATE application/x-javascript
AddOutputFilterByType DEFLATE application/x-httpd-php
AddOutputFilterByType DEFLATE application/x-font
AddOutputFilterByType DEFLATE application/x-font-opentype
AddOutputFilterByType DEFLATE application/x-font-otf
AddOutputFilterByType DEFLATE application/x-font-truetype
AddOutputFilterByType DEFLATE application/x-font-ttf
</IfModule>
SetEnvIf Request_URI".* "AllowCountry

.htaccess

2022-09-30 21:32

1 Answers

Try adding RewriteBase/.

Options + FollowSymlinks
AddDefaultCharsetutf-8

# Normalized with www
RewriteEngine on
RewriteBase /< - Add
 :::


2022-09-30 21:32

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.