Redirect if subfolder is not present in url

Advertisements I’m looking to create a redirect if url begins with /folder but does not contain /folder/subfolder Eg: /folder/page Should redirect to: /folder/subfolder/page I’ve tried RewriteCond %{REQUEST_URI} !^/folder/subfolder/.*$ RewriteRule ^(.*)$ /folder/subfolder/$1 [L] But that doesn’t work. It needs to be a general redirect as I have many pages to redirect. It should be possible, right?… Read More Redirect if subfolder is not present in url

301 Redirect is Not Working with Index File

Advertisements I’m trying to 301 Redirect the Index.php to another URL Here’s my htaccess codes Options +FollowSymLinks RewriteEngine on Redirect 301 /index.php /en1 RewriteRule en1 index.php [NC] My domain for example is http://www.mysite.com I want this to work as http://www.mysite.com/en1 In the URL bar its showing the new URL but browser says The page isn’t… Read More 301 Redirect is Not Working with Index File

RewriteRule to match string NOT containing dot (.) only if it also does not contain another specific word

Advertisements So, I’m trying to have a RegEx at my .htaccess that uses RewriteRule to redirect website. My idea is to redirect all URLs that are not files, and I used to do it like this: RewriteRule ^([^\.]+)/?$ index.php?url=$1 [L] Problem with this ^([^\.]+)/?$ RegEx is that URLs like following are not being rewrited when… Read More RewriteRule to match string NOT containing dot (.) only if it also does not contain another specific word

remove a specific part from url with htaccess and redirect

Advertisements I was using translatepress on my wordpress site so my site urls were like dynamiclinic.com/en-ae/hair-transplant but now I have removed translatepress so now my urls are like dynamiclinic.com/hair-transplant but I have submitted urls for SEO with en-ae slug. I want that if en-ae is present in any URL then it gets removed automatically and… Read More remove a specific part from url with htaccess and redirect

Directory redirect with htaccess and duplicated content

Advertisements I got a problem with my subdirectory redirecting. I’ve got this project structure: public_html public landing-page nuxt_app app .htaccess In this structure I have app which is located in public_html/public/app and url to it is like this: http://www.example.com/app and I have landing-page dir which url is http://www.example.com. I’ve used httpd configuration to move root… Read More Directory redirect with htaccess and duplicated content

Simple Rewrite Rule issue

Advertisements I have a bit of hard time trying to understand what is wrong with the 3rd line of this rewrite rule : Options +FollowSymLinks RewriteEngine On RewriteRule ^(.*)\.html$ $1.php [L] RewriteRule ^fr/lecon-de-kite\.html$ kite-lessons.php?lang=fr [L] RewriteRule ^fr$ index.php?lang=fr [L] RewriteRule ^it$ index.php?lang=it [L] when I try to reach http://localhost/kitemeup/fr/lecon-de-kite.html I get an Not Found error… Read More Simple Rewrite Rule issue