Chaining multiple required rewrites in .htaccess

I have at present 2 rewrites that are supposed to occur on any given url, The first redirects any url matching the pattern %DOMAIN%/mcc-* to show.php?id=mcc-* The second redirects any url without the .php extension to the page as if it had one. The first rewrite gets called and works, but the second does not.… Read More Chaining multiple required rewrites in .htaccess

Redirect if subfolder is not present in url

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? >Solution… Read More Redirect if subfolder is not present in url

301 Redirect is Not Working with Index File

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 redirecting… 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

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 I… 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

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 gets… Read More remove a specific part from url with htaccess and redirect

Directory redirect with htaccess and duplicated content

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 directory… Read More Directory redirect with htaccess and duplicated content

Simple Rewrite Rule issue

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 >Solution… Read More Simple Rewrite Rule issue