Skip to main content
The 2024 Developer Survey results are live! See the results

Questions tagged [.htaccess]

Directory-level configuration file used by Apache web servers. Use this tag if and only if .htaccess content is directly involved in the topic. We know many people are using .htaccess, but kindly ask the members of the community to not use this tag, unless you know it is on-topic in your question. Also notice what the [tag:apache] tag has to say about questions about _configuring_ Apache httpd and their potential off-topicness on Stack Overflow

0 votes
0 answers
8 views

IP addresses accessing my website bypassing Deny All in .htaccess

I am building my website. I added the following to my .htaccess to deny access to all IP addresses but mine. #allow access only from my ip address order deny,allow deny from all allow from <my IP ...
jdias's user avatar
  • 5,684
-3 votes
0 answers
20 views

Change url by .httaccess [closed]

We have renamed images url directory due to some new implementation. So now all images start showing 404 errors. 404 path: https://fls.example.com/storage/media/...
Shiv Singh's user avatar
  • 7,126
0 votes
0 answers
22 views

htacess rewrite directory inside directory

On my server the domain "domain.com" points to "/docroot/" I would like to rewrite all requests from "domain.com/example1" to get files and directories located in: "/...
ferqusanga's user avatar
0 votes
0 answers
14 views

Yet another .htaccess RewriteRule Condition not being met

This is the baseurl "http://tkrn.io/u/tkrn/1337test.exe" and I'm looking to rewrite it to "http://files.tkrn.io/tkrn/1337test.exe" RewriteEngine On RewriteRule ^u\/(.*)$ http://...
tkrn's user avatar
  • 606
0 votes
0 answers
19 views

htaccess redirect folder or empty folder

I have a redirect working fine as follows: RewriteRule ^folder/(.*)$ /file.php?variable=$1 [L,QSA] So it will send domain.com/folder/foo --> domain.com/file.php?var=foo But when there is no ...
Mike Darling's user avatar
-2 votes
1 answer
37 views

Typing the text ".htaccess" (no quotes) into a html5 input text or textarea field causes 403 page on form submit [closed]

while testing my html5,js,php project form, i discovered that if i type .htaccess into a text input field or a textarea field that it causes the 403 forbidden page when i submit the form. I understand ...
dave's user avatar
  • 21
3 votes
1 answer
24 views

redirect 301 site all urls www to non-www with https in htaccess

I can't redirect my all website pages, in www to non-www and https I use Laravel 11 I try this, but it's just work for my home page: RewriteCond %{HTTP:X-Forwarded-Proto} =http RewriteRule ^ https://%{...
Mordad Khezerlou's user avatar
0 votes
2 answers
35 views

redirect URL with query string to URL without query string

I have recently migrated from asp.net website to wordpress. My old urls look like this domainname.com/heating-cooling-new-york-city.asp?tn=Washington%20Heights I want to redirect this url to ...
Shannon martin's user avatar
-2 votes
1 answer
46 views

Problem with .htaccess redirection to my API

I have a WordPress site in which I develop a plugin. Inside this plugin, I developed a API. In my local environment, my URL to access my site is http://localhost:81/site. I'd like requests made to ...
Marlon's user avatar
  • 1,817
0 votes
1 answer
45 views

How to redirect in htaccess without blocking php api?

I have an index.php file which is located in the root directory. This outputs either HTML or JSON, depending on the URL: <?php require_once('./../private/Router.php'); new Router(); ?> &...
RoyBlunk's user avatar
  • 141
0 votes
1 answer
14 views

RewriteRule /category?id=2 to /index.php?cat=2

I want /category?id=2 to redirect to /index?cat=2 in .htaccess I have tried with the following code RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME} !-f RewriteRule ^category?id=$ /...
Andreas Thomsson's user avatar
-2 votes
0 answers
11 views

Wordpress - rewrite all traffic from a subfolder in a subfolder to subfolder [closed]

my problem is that this scenario wont work with my tries. Example www.test.de/subfolder/ is a valid wordpress site and rewrites to index.php www.test.de/subfolder/subfolder/ is not a valid wordpress ...
Stefan Damann's user avatar
-3 votes
0 answers
24 views

Bloqueio de PDFs no site Wordpress via Htaccess [closed]

Tenho o seguinte código: # Verificar se o arquivo solicitado é um PDF RewriteCond %{REQUEST_FILENAME} -f RewriteCond %{REQUEST_URI} \.pdf$ [NC] RewriteCond %{HTTP_COOKIE} !user_logged [NC] # ...
Michel Sena's user avatar
0 votes
0 answers
24 views

Htaccess for protecting gravity forms uploads

I have the following code to make sure that the gravity forms directory in the uploads folder and it's contents cannot be accessed by non-logged in users. <IfModule mod_rewrite.c> RewriteEngine ...
Ashtheslayer's user avatar
1 vote
0 answers
28 views

How To Allow Popup Ads Only On Certain Website Pages Using .htaccess File

As a webmaster I would like to exclude popup ads on certain specific webpages on my website whos url ends with a particular string. Example : https://mywebsite/some-slug-variable/?gallery=submit I am ...
Nicodemo's user avatar

15 30 50 per page