skip to Main Content

.htaccess Rewrite: how to ignore sub pages – WordPress

I have WordPress pages like https://example.com/mainpage https://example.com/mainpage/sub-page1 https://example.com/mainpage/sub-page2 https://example.com/mainpage/sub-page3 I have written a RewriteRule just for mainpage RewriteRule ^mainpage$ mainpage.php [L,QSA] also tried RewriteCond %{REQUEST_URI} !^/mainpage/sub-page1 RewriteRule ^mainpage$ mainpage.php [L,QSA] and RewriteCond %{REQUEST_URI} !^/mainpage/.*$ RewriteRule ^mainpage$ mainpage.php [L,QSA] but all…

VIEW QUESTION

.htaccess rewriteCond part of the url – Apache

URL applying rule(s): https://olddomain.ch/de/qahmkitd73/ https://olddomain.ch/fr/qahmkitd73/ https://olddomain.ch/en/qahmkitd73/ RewriteCond %{HTTP_HOST} chezcamillebloch.ch$ RewriteCond %{REQUEST_URI} ^/.*/qahmkitd73/$ [NC] RewriteRule .* https://newdomain.ch/$1/qahmkitd73 [NE,R=301,L] this should redirect to https://newdomain.ch/**/qahmkitd73 the ** should be dynamic from the URL (de/ or en/ or fr/)

VIEW QUESTION
Back To Top
Search