简体   繁体   中英

301 Redirect to subfolder but with input

I want my wordpress site redirections to remember the url but place it in a subfolder.

So http://www.example.com/test123 has to redirect to http://www.example.com/voetbal/test123

And http://www.example.com/0239 to http://www.example.com/voetbal/0239

My htaccess looks like this.

RewriteEngine On
RewriteBase /voetbal/
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /voetbal/index.php [R=301, L]

this makes my site go from http://www.example.com to http://www.example.com/voetbal/ but only the root.

How can i make my htaccess to remember peoples input and place it after the /voetbal/

Try :

RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^ /voetbal%{REQUEST_URI} [L,R=301]

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