简体   繁体   中英

.htaccess: redirect with different subfolders

Being not 100% familiar with .htaccess files, I spent already days in fixing one tiny issue, but with a huge impact. I want to create a line in my .htaccess file, which should be something like:

RewriteRule ^folder1/folder2/folder3/([^.]+)/?$ /folderA/folderB/page.php?variable=$1

I found out that the below piece of .htaccess code seems to work:

RewriteRule ^folder1/([^.]+)/?$ /folderA/folderB/page.php?variable=$1

But by adding /folder2/folder3, the RewriteRule is not working properly anymore. These extra folders are the only difference, but I must be doing something wrong.

Is there anyone who can help me out on this? I'm really lost...

Many, many, many thanks in advance for your help!

Invisible in my ftp, but visible within my Plesk server, I noticed there was a .htaccess listed in /folder2/. After removing that file, the line in the above described .htaccess works fine.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM