Category ".htaccess"

Vite outDir outside of the project root

I am building Vue3 project with Vite and I am using Vite build.outDir option to build the project outside of the Vue3 app root. This is my project structure, wh

HTTP authentication with PHP for specific pages

I have been trying to fix one issue for the last two weeks but didn't find any solution to my problem. So, I am trying to add HTTP authentication with PHP 7.4.

How to redirect URL with query string without name to new url

I have these URLs https://example.com/team?1892 https://example.com/team/?1892 which I need to redirect to https://example.com/team/whatever/ How can I do tha

htaccess how to prioritize RewriteCond

We recently migrate our new website and we need to adjust htaccess to avoid 404 error with the search engine, The website was a Multilanguage site we decided to

htaccess fails to allow domain access to sub-directory

I have a sub-directory on a site with a zip file in it. I want to limit access to the zip file to certain domains. I have tried many methods but none are workin

.htaccess do not preload files on Ajax calls

I have some website running with PHP. In my .htaccess I have added the following directives: <FilesMatch "index.php"> Header add Link "</css/bo

.htaccess Use variables to check if subpage exists

I have a website, which is a one-pager JS-based site. It has different "subsites" and "categories", but since everything is controlled via JS, and since there a

Create missing .htaccess file in wordpress and add the default wordpress .htaccess rewrite rule in it

I am stuck in a difficult situation here I have hundreds of addon and subdomains under my "public_html" having WordPress instances inside them. While cleaning u

Specify Image Size With .htaccess

I want to be able to add some code to my .htaccess file that allows me to generate differently sized images by adding "?w=100&h=100" after the URL. Does any

removing .php extension and creating dynamic url from htaccess

I have following code for hiding php extension and redirecting user to a non .php url if user adds a .php extension in url for example domain.com/about.php shou

.htaccess 301 redirect with exclusion does not work

I try to use a simple 301 redirect from domain1.com/folder/ to domain2.com/ but excluding domain1.com/folder/subfolder I use the following code in .htaccess: Re

Replace part of a long URL and redirect

Is there a way to redirect the URL as follows: URL is generated based on a filtering system so it is like this https://example.com/product-category-no-slash-gen

redirect 301 url htaccess /do.php?id=15 to download15.html [duplicate]

I hope everyone is fine. I want to convert links like this /do.php?id=15 to /download15.html I applied this step but it doesn't work Redire

WordPress Redirection Plugin Redirect

I'm trying to redirect a page and any subpages to the root but I can't find a way of doing it. I'm using the redirection plugin (https://redirection.me/). I wou

.htaccess rewrite rule from end of path

I need to rewrite the rule for my url according to this pattern: Starting url : https://example.com/path/&param1=1&param2=2 Destination url: https://exa

Preflight CORS error followed by 404 error

I am experiencing an issue when trying to get data from API for my react app. I am trying to pass protect my API using htaccess file so when trying to send auth

Remove '.php' file extension but still validate paramaters after trailing slash?

I've been searching for how to do this, and I haven't been able to get anything to work yet. I want to remove the '.php' file extension from all files that have

apache virtualhost site using .htaccess not working

I am running brew/apache on on my local machine (mac-os monterrey). I want to configure virtual hosts. The lookup for one of the virtual host (panierssaison.loc

Htaccess doesn't let access to sub directories with parameters

I am trying to create a htaccess for seo urls, I created my htaccess all urls works fine exclude subfolder with parameters, they redirects to sitefolder. sitefo

How to pass a cookie value as a parameter with multiple rewrite conditions in htaccess

I want to first check if the request URI is an image and then check for a cookie and pass both the values as parameters to a file in the multiple rewrite condit