Questions tagged [htaccess]

The most common name of the per-directory settings file for the Apache server. WordPress stores the mod_rewrite configuration for "Pretty Permalinks" here. [url-rewriting] should be used for the WordPress rewrite system in general, [mod-rewrite] when you talk specifically about the Apache module.

Filter by
Sorted by
Tagged with
0 votes
1 answer
28 views

FilesMatch in htaccess

Suddenly my WordPress site is not working - looking at .htaccess it has <FilesMatch ".(py|exe|php)$"> Order allow,deny Deny from all </FilesMatch> <FilesMatch "^(about....
anjanesh's user avatar
  • 111
1 vote
1 answer
16 views

wp-content/uploads/year/month returns 404

I have a litespeed hosting I have disabled all plugins and all wordpress related htaccess rewrites. If I go to https://digitalzoomstudio.net/wp-content/uploads/2023/ - then I can see the directory ...
digitalzoomstudio's user avatar
0 votes
0 answers
11 views

images inside uploads folder will return 404

My images will not load . accessing anything inside the uploads folder returns 404 https://digitalzoomstudio.net/wp-content/uploads/2022/11/image-1-1024x617.png I am 99% sure I am not crazy and that ...
user237193's user avatar
1 vote
1 answer
8 views

How do we ReWrite HTACCESS to point a cat/subcat Product URL, to Cat/ only?

We have a problem where a site has got some odd URLs indexed by Google. This is the incorrect path: example.com/shop/mens/jeans/jean-product/ This is the correct path: example.com/shop/mens/jean-...
Simon_a6's user avatar
0 votes
0 answers
19 views

Allow file access only via cookie

I need to have groups of PDF files on a site that are protected by different passwords, which I have solved with WPYog Documents plugin to create individual document repositories and Passster plugin ...
Pavel's user avatar
  • 1
1 vote
1 answer
22 views

Wildcard multisite wp-admin url wrongfully redirected

So, this is the situation. I have a working top level domain site (https://example.com) and I set up a wild card subdomain (*.example.com) and multisite settings in WordPress. It works as expected, as ...
Sven V's user avatar
  • 11
0 votes
0 answers
13 views

Change WordPress Multisite Domain to subfolder

I want to change my existing WordPress Multisite main site to be in a folder. For example, this is my current main site of the network: example.com. Other domains in the network have folders like ...
Cray's user avatar
  • 145
0 votes
2 answers
42 views

Security headers disappear on Wordpress pages

I am facing a problem that both me and my host support team were unable to untangle. I have included security headers in my .htaccess file (see below), but I get inconsistent results: All the headers ...
AnalysisStudent0414's user avatar
0 votes
0 answers
9 views

how to redirect static folder to wordpress page?

I have wordpress installed, but under the root directory of my website I also have several folders used to store documents not uploaded through wordpress (e.g. pdf files of articles written by certain ...
Jon Fergus's user avatar
0 votes
1 answer
27 views

Redirect all pages to a specific page of a new domain but exclude specific pages

I'm trying to redirect all pages of example.com to a specific page domain.com/rebrand-explained except for the following pages, they need to be going to the same slug on the new domain for example: ...
Johan Barnard's user avatar
0 votes
0 answers
25 views

Intercept numerical subdomain requests

Is it possible, via .htaccess to intercept all numerical subdomains ex. (02321.example.com), and forward them to example.com/02321 ..and HOW do i write it (i'm not god at regex) and how to get NOT ...
Adam Larsson's user avatar
0 votes
0 answers
18 views

Bulk 301 redirect for Taxonomies with pagination

I'm looking for the best way to bulk redirect for modified taxonomy URLs. After category slug has been changed, I need to perform a redirect for all paginated pages: /category-old/ redirects to /...
Alexius The Coder's user avatar
2 votes
2 answers
32 views

Does WordPress automatically redirect to the URL specified in settings?

My WordPress site used to require htaccess rewrite rules to redirect non-www to www (or vice versa) and http to https. Without those rules, the site would be accessible at whatever URL the user ...
Dave's user avatar
  • 119
0 votes
0 answers
23 views

URL rewriting problem

He guys, I would like to rewrite URLs like the following one: https://my.domain/blog/2023/09/18/newsname to the following https://my.domain/newsname So, category (and maybe even subcategory) and date ...
mnahrgang's user avatar
0 votes
0 answers
32 views

All Pages and Post are redirecting to 404 Not Found in wordpress

I am using wordpress, I have created 3 pages and 4 posts on my website. I am able to access the front page but the rest of the pages are showing 404 not found, Same for post also. If I use some logic ...
Naren Verma's user avatar
0 votes
1 answer
24 views

Wordpress website hacked - index.php file modified

My website has been hacked, that is when I click any page its redirect to home page. Unbale to open wp-admin as well. I checked the server, it seems root folder index.php file has been modified with ...
Anish's user avatar
  • 1
0 votes
0 answers
30 views

Can't access folder other than WP folders in same directory

I have a tutorial website that shows the live demos too now in the WordPress installation directory, I have created a folder named live-demos and pur a new folder with the demo name e.g example.com/...
Muhammad Ahmed's user avatar
0 votes
1 answer
74 views

wp-login - unable to redirect user to a custom login url

I have this code in a template file that will contain my vue app that I want to load in WordPress. <?php /* * Template name: App */ ob_start(); get_header(); if( is_user_logged_in() ) { ?> ...
ICTDEV's user avatar
  • 113
0 votes
0 answers
49 views

htaccess RewriteEngine On - Forbidden You don't have permission to access this resource

i made a staging site on subdomain on var/www/stagin but when I want to access it I get; Forbidden You don't have permission to access this resource. in htaccess I have RewriteEngine On enabled, when ...
PC Welcome's user avatar
0 votes
0 answers
32 views

Change WooCommerce Product Permalink Structure

According to my suppliers they want the local site and the international site to have the same product URL's just different domain. However my site is built on WooCommerce and there's is a custom PHP ...
Alex Moura's user avatar
1 vote
1 answer
88 views

Why is this line of code Wrong in every Wordpress .Htaccess security article?

The following line of code (RegEx) is partly wrong in every Wordpress .Htaccess hardening article I've seen. Why is that? <FilesMatch "^.*(error_log|wp-config\.php|php.ini|\.[hH][tT][aApP].*)$&...
Yahya Tarjuman's user avatar
1 vote
0 answers
27 views

Return 403 for specific paths in Wordpress

my site has been compromised and now crawlers try to index thousands of pages that no longer exist. I would like to return a 403 for these attempts because the query limit of the hosting has been ...
vendrillo's user avatar
0 votes
0 answers
107 views

How can I point headless wordpress admin panel links to proper urls without using frameworks?

I have a headless wordpress website. The frontend, built using React, without headless WP frameworks, is in the public_html directory. The wordpress backend is in the public_html/back directory. ...
budgiebeaks's user avatar
0 votes
0 answers
53 views

How to do SEO friendly filters urls?

I have a WordPress website. It uses Woocommerce. All products are loaded and attributes are created. When the user opens the catalog page and selects the filter values, there are problems with the URL....
Artm's user avatar
  • 1
0 votes
1 answer
65 views

Hardening WordPress - how to set .htaccess permissions?

I have been reading about File Permissions in Hardening WordPress on wordpress.org When it comes to .htaccess, the guide currently says The root WordPress directory: all files should be writable only ...
Dave White's user avatar
-1 votes
1 answer
30 views

cant access website thru www only works on direct xyz.com

i have recently migrated my website to kinsta. the site is not loading when you enter https://www.example.com with the domain, but loads well on https://example.com please give some pointers to ...
Muhammed Muneer's user avatar
0 votes
1 answer
60 views

How can I make /wp-admin the root url?

So. I want my users to type: https://example.com and immediately come into the WordPress admin panel. Ideally without seeing wp-admin in their browser. The only users of this site are admins, creating ...
Kropotkin's user avatar
  • 169
0 votes
1 answer
64 views

Allow requests to resources outside the wordpress folder

I have wordpress website https://example.com. /wordpress is never part of the url. It runs on a dedicated server that runs Plesk Onyx. The file structure is | - httpdocs | - wordpress | - ....
Sam Dean's user avatar
  • 101
0 votes
1 answer
16 views

Redirect loops in Bing holding my sites back

Have been running HTTPS for a while and everything is good. I was looking at the webmaster tools on Bing and it shows some redirect loops going on. I see thousands of them. I've looked at all the ...
The King Repairs's user avatar
0 votes
1 answer
223 views

How do I modify each instance of setcookie?

I have an internal WordPress site that I'm trying to embed via iFrame. Currently, I'm stuck on: Error: Cookies are blocked or not supported by your browser. You must enable cookies to use WordPress. ...
Kermit's user avatar
  • 146
0 votes
0 answers
42 views

WP-Include rewrite directory

I try few day to rewrite wp-include directory but not success. In .htaccess I add next line <IfModule mod_rewrite.c> RewriteEngine On RewriteBase / RewriteRule ^main/(.+) /wp-includes/$1 [L,...
kuribo's user avatar
  • 1
1 vote
0 answers
219 views

Subfolder install not working

I have my main site inside the root public_html folder, and that is working fine. Alongside that I have 2 subfolder installations, out of which only one is working. I made no changes to my .htaccess ...
dingo_d's user avatar
  • 1,939
0 votes
0 answers
25 views

Post pages are redirecting to the 404 page in wordpress

In my root folder, I have installed WordPress. Now I have created a resources folder in the root and installed WordPress in that too. I am able to login into the resources admin panel and created ...
user9437856's user avatar
0 votes
0 answers
41 views

Permalinks not working on debian with OVH

Hi, How to fix 404 errors from permalinks ? I tried to change https://website/?page_id=690 to https://website/salle-de-bain on my website. So I go on settings > permalinks and do a /%postname%/ ...
P W's user avatar
  • 1
0 votes
0 answers
41 views

Browser Caching .htaccess

I must be missing something. Here is the excerpt from my 'htaccess file'; <IfModule mod_expires.c> ExpiresActive On # Images ExpiresByType image/jpeg "access plus 1 year" ...
BadScooter1980's user avatar
1 vote
1 answer
70 views

Redirect old homepage to the new one within the same site

I am wondering how can I redirect the old homepage https://blog.example.com/ to the new one https://www.example.com/ratgeber/ I have tried to redirect it via a WordPress Plugin, but when I insert the ...
Roman Trushanov's user avatar
1 vote
1 answer
592 views

How To Add CSP frame ancestors in Wordpress Website? [closed]

I'm trying to add Content Security Policy (CSP) frame ancestors in .htaccess file to prevent our website from getting iframed on other websites. Following is the code: <IfModule mod_headers.c> ...
Vaibhav Singh's user avatar
0 votes
0 answers
61 views

Wordpress site down for my IP only after trying to implement .htaccess whitelist

UPDATE: the problem seems to have solved itself now, about 24 hours later. It would still be useful to know what happened, though. My team and I have tried to make 2FA plugins work with WordPress a ...
Mark's user avatar
  • 1
0 votes
0 answers
40 views

Rewrite Rule in htaccess convert query string into slashes

Please examine and correct this code: I want the code to work such that if somebody visits https://example.com/music/?record_year=2022, it should be https://example.com/music/record_year/2022 instead. ...
John Ovye Godwin's user avatar
1 vote
1 answer
37 views

Standard Htaccess directives disappear by themselves

I have an odd issue on one of my websites. I'm talking about the standard, native, url directives put by wordpress, that just plain disappear from time to time, which of course breaks my site. Here is ...
Bucheron's user avatar
0 votes
0 answers
51 views

Increase Upload Size with htaccess | MAMP

I want to increase the upload size of my WP installation. It works on my host, the live version of the page. But I can't reproduce it locally. I run it with MAMP. I did: php_value upload_max_filesize ...
S.H's user avatar
  • 105
5 votes
3 answers
258 views

How to use 'blogs.dir' as media upload instead of 'uploads' directory in WordPress multisite setup

Setup 1 : The general subdomain/custom-domain based multisite setup for child network sites has its upload directory like this /home/example1.com/public_html/wp-content/uploads/sites/8/2022/01/logo....
AnupRaj's user avatar
  • 206
1 vote
1 answer
167 views

.htaccess seems to be required but I can not find it

I installed WordPress on Ubuntu 22.04 and when I tried to write a post or edit the default post that comes pre-installed I got an error message: The response is not a valid JSON response After a lot ...
user3425506's user avatar
0 votes
0 answers
72 views

301 Redirect posts to newly added categories

I've added categories to my WordPress posts and changed the permalink structure to /%category%/%postname%/. now, it looked like this: https://domain.com/category/post-slug/ but I want the old ...
goodnight sir's user avatar
0 votes
0 answers
56 views

Use Regex Redirection via htsaccess for RSS Feeds WordPress

Can anyone help me to write a 301 redirection code for RSS feeds using Regex in htaccess file? Below are some reference conditions; MAIN URL Redirect https:// www(.)mydomain(.)com/feed TO https:// ...
user avatar
1 vote
0 answers
24 views

WordPress is adding pagination for all pages not only for blog page, How to remove pagination for all pages except blog/posts page?

You know WordPress is adding pagination for all pages not only for posts page/blog page. For example www.mysite.com, I'm getting URLs like www.mysite.com/page/15, etc. Here, www.mysite.com has a ...
Murali Krishna P's user avatar
1 vote
1 answer
77 views

Add rewrite endpoint and .htaccess

I'm trying to make a redirection with .htaccess and rewrite endpoint (add_rewrite_endpoint()) and it's working but at the time of redirection it adds a /1/ to the route and I don't understand where it ...
Javi Ps's user avatar
  • 113
0 votes
0 answers
171 views

404 error in dashboard of subdomain of multisite

I am getting a 404 error whenever I click to ender the dashboard of my subdomain and on the front end, I am getting an "Index Of /" for the same subdomain. I've followed the instructions in ...
Shimel Kemoa's user avatar
2 votes
2 answers
452 views

How to use multiple 404 Error Pages in Wordpress

I have a question and couldn't find a solution for it. We have a Wordpress page where the client wants multiple error pages. 1 error page is in the usual normal 404.php for the custom theme which we ...
Jaba's user avatar
  • 53
0 votes
1 answer
100 views

Other pages fine but wp-admin showing ERR_TOO_MANY_REDIRECTS Error

wp-admin showing ERR_TOO_MANY_REDIRECTS Error and can't let me login into dashboard but Other pages loading fine. FIXED
rawaha johns's user avatar

1
2 3 4 5
27