When I set the redirect to a certain directory, I want to exclude it only when a specific file in the directory is accessed.
The location of htaccess is located in root.
The folder structure is as follows, but how is it written differently?
root/.htacess
root/kodomo/tamago.html
root/kodomo/karaage.html
root/chugoku/men.html
root/itaria/pasta.html
RewriteEngine On
RewriteBase /
RewriteCond% {REQUEST_URI}! ^/Kodomo/tamago.html $
RewriteCond% {REQUEST_URI}! ^/Kodomo/karaage.html $
RewriteRule kodomo (. *) Https://dummy.com/kids/ [R = 301]
RewriteCond% {REQUEST_URI}! ^/Chugoku/men.html $
RewriteRule chugoku (. *) Https://dummy.com/china/ [R = 301]
RewriteCond% {REQUEST_URI}! ^/Itaria/pasta.html $
RewriteRule itaria (. *) Https://dummy.com/italy/ [R = 301]
What happens when you visit
First processing phenomenon (processing I want to achieve)
You can redirect ◯
https://sample.com/kodomo/
↓
https://dummy.com/kids/
Excluded ◯
https://sample.com/kodomo/tamago.html
Symptom after the second processing (processing)
RewriteCond% {REQUEST_URI}! ^/chugoku/men.html $
RewriteCond% {REQUEST_URI}! ^/Itaria/pasta.html $
You can redirect ◯
https://sample.com/chugoku/
↓
https://dummy.com/china/
Not excluded x
https://sample.com/chugoku/men.html
↓
https://dummy.com/china/
-
Answer # 1
Related articles
- i can't redirect individual pages with htaccess
- htaccess - i want to redirect unnecessary generated pages (https://samplecom/page/2/) to top (https://samplecom/)
- what should i do if i want to exclude only the top page in the htaccess 301 redirect when moving the site?
- [ie operation with excel vba] i can't get data from multiple pages by turning the pager
- php - i want to exclude only one specified term from the list of multiple custom post types
- htaccess - regarding the redirect processing from the old domain to the new domain, i want to redirect the page that is "no
- what is the priority of htaccess redirect and php redirect? ?
- htaccess - about 301 redirect with parameter in httaccess
- htaccess - i want to solve the redirect loop when normalizing the url
- htaccess - about 301 redirect method
- i want to scrape multiple pages using ruby on rails mechanize
- Laravel modify htaccess file redirect public solution
- htaccess - how to redirect all access to the source to the top page of the destination
- Detailed usage of multiple redirect methods in Django
- Vue + Elementui method for coexistence of multiple tab pages
- Vue's way to redirect 404 pages in Nuxtjs
- webpack method for packing multiple pages
- Webpack 3X learns how to pack multiple pages
- create-react-app modified to support multiple pages
- Vue-cli sample code to implement multiple pages and multiple routes
This led to self-solving. It seemed to be a problem that occurred without RewriteCond being enabled.
.Htaccess is placed in each directory, and it can be realized safely with the following description.
Thank you for your answer.