A message from our CEO about the future of Stack Overflow and Stack Exchange. Read now.

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
1answer
13 views

how to redirect 404 to attachment.php?

I have a problem, I have many url attachments with / amp, example: siteweb.com/article-2019/image2/amp siteweb.com/article-2019/image3/amp siteweb.com/article-2019/image4/amp all these give me 404 ...
2
votes
2answers
124 views

Wordpress-site can be reached on x.x.x.x/index.php - but not directly on the IP without index.php

Brand new WordPress install with Avade Theme installed on RPi 4 - works fine when I access it on http://203.0.113.111/index.php from an external connection, but if I remove the index.php I get nothing ...
1
vote
1answer
11 views

How to ignore folder in site root while accessing a URL

I have a folder in my site's public_html directory called /connect. The folder is causing the page sitename.com/connect to access a parent index page instead of the Wordpress page set up. Deleting ...
0
votes
1answer
28 views

Blocking wp-login in HTACCESS has also blocked password protected pages

We recently blocked all IP addresses except mine and the company owner's from getting to /wp-login.php except today we discovered this has inadvertently blocked any other password protected page. By ...
0
votes
0answers
26 views

Rewriting request to another site

I have a multisite WP instance set up to use subdirectories. I have a few pages that should have URLs on each site. The content will be (almost) the same, so I wanted to just make the pages once and ...
0
votes
0answers
18 views

My site working fine via mobile internet but Problem in WiFi internet

I have a site on WordPress like https://www.fileour.com. Now I have confirmed. My site is problem only in WiFi network around in only on full Bangladesh. But everything is fine through any mobile ...
1
vote
1answer
20 views

how to redirect 301 my old search query string to wordpress search query string?

How to redirect 301: /cgi-bin/mt/mt-search.cgi?search=WORDS to https://example.com/?s=WORDS in .htaccess file?
0
votes
1answer
16 views

Redirect wordpress site to www from non www on wordpress server

I am working on a Wordpress project which is deployed on wordpress.com hosting. Simply I want to redirect the website from (with SSL)non-www to (with SSL) www. I have searched over web and there are ...
0
votes
0answers
27 views

Getting file errors in a Wordpress Multisite ADMIN

This is for a multisite that has 3 levels of organization: main site - regions (subsites) and locations (sub-subsites). So you would be able to visit and administrate these urls: domain.com --> main ...
2
votes
1answer
28 views

How disable SSL redirect for specific URL?

I have a specific URL that has to be accessible without SSL, so that some old devices can access it. The reason is those old devices have the URL hardcoded. The URL is http://domain.com/server My ....
0
votes
0answers
21 views

How to make the redirects right? IP to domain name folders

Recently added a domain name and there are pages/links that still include the IP address and when pressed redirects from http://ipaddress/subfoldersite/folder to mydomain.com. I have multisite network ...
0
votes
4answers
77 views

Category URL's 404 after setting category base to '.'

I want to remove /category from URLs. I have set category base to "." I have some "category urls" which previously looked like /category/category-name/sub-category-name They are now /category-name/...
0
votes
0answers
27 views

302 redirect *.at/site redirecting to .comsite

My WordPress site xy.at/site is redirecting to xy.comsite instead of xy.com/site. Is it possible to fix this in the .htaccess file? The .htaccess file currently looks like this: <IfModule ...
3
votes
2answers
55 views

Redirect www to non-www htaccess

It's been asked a gazillion times but it's still not working in my Wordpress. I want to redirect everything to https://website.com. Current code been used: <IfModule mod_rewrite.c> ...
1
vote
0answers
27 views

Wordpress Content Security Policy and Subresource Integrity

I have tested my website at https://observatory.mozilla.org/ and I receive the following two errors: Content Security Policy -25 Content Security Policy (CSP) header not implemented Subresource ...
1
vote
1answer
33 views

Transfer to HTTPS - mixed content on main page only [closed]

I am having a problem with mixed content on the website after enabling SSL. The strange thing about it is, only main page is affected (though the same assets are used through the whole website). The ...
1
vote
1answer
32 views

NextGEN Gallery Lightbox - Social Share URL Redirect

I am using NextGEN Gallery Pro - Lightbox's Social Share feature on my WordPress site which actually create and share a temporarily created url (first-url) on social media. Somehow the redirect doesn'...
0
votes
0answers
14 views

Using cache brokes redirecting

In my .htaccess I have a rewrite rule to redirect from /index.php to /, and it works perfectly immediately after I clear cache, but doesn't work after some time (maybe page /index.php got cached). I'm ...
1
vote
2answers
63 views

Cannot Access Admin Area After Migration

I have a problem after migrating a WordPress site from Plesk and IIS to LAMP server. I cannot access the Admin Panel, I can access /wp-admin/ and can login successfully but I get redirected to the ...
2
votes
1answer
30 views

Blocking access to wp-login via htaccess not working

Some time ago I installed the Limit Login Attempts Reloaded plugin and it's working fine. However because I was getting SO many unauthorized login attempts I also implemented an .htaccess password ...
1
vote
0answers
16 views

Change Search url slug for each site in a multisite network

As per the title, how would you change the search url for different sites in a multisite network. eg: testsite.co.uk/search testsite.de/suchen testsite.fr/recherche I can change the search term for ...
0
votes
2answers
33 views

WordPress URL redirect and replace ? question mark

Following is example of what we are looking for. We're trying this in wordpress and we require all parameters as a variable Example 1 : http://example.com/tno/?parent=abc Need this : http://example....
2
votes
2answers
219 views

Error “Call to a member function switch_to_locale() on null” during insert_with_markers

Having an issue with my plugin updating the htaccess file. The code I used to do that is: insert_with_markers($htaccess_file, $marker, $lines); The parameters used in that function have been ...
0
votes
0answers
14 views

How to allow URL with filename & extension in wordpress?

How to create custom URL routes? I wanted to generate csv using specific url for ex. https://www.example.com/exportcsv.csv Is this possible via WordPress? I have tried with querystring and all the ...
0
votes
0answers
55 views

Basic Auth .htaccess on wp-login, but allow logout from woocommerce

I use a .htaccess basic auth on my WC site to help prevent hackers accessing wp-login, which works well... except with WooCommerce if a logged in customer wants to logout from their account - upon ...
1
vote
0answers
67 views

Why does multisite bypass WordPress for wp-content, wp-admin, wp-includes and .php files?

When you set up WordPress to use multisite, you're directed to modify your .htaccess file to use one of the following, which are outlined in the admin and the WordPress documentation: Subfolder ... ...
0
votes
0answers
25 views

Prevent canonical redirect for staging (pre-production) domain only

We have a single wordpress instance that is accessible in two different domains: https://example.com/wp/ and https://staging.example.com/wp/. The first is the canonical site, but the second should be ...
1
vote
1answer
31 views

Directing subdomain to main domain and keeping the subdomain format with .htaccess

I am using bluehost and a single site wordpress site. I want when someone types in bob.example.com to show the Wordpress site at example.com, but still use the subdomain address (bob.example.com). I ...
1
vote
1answer
17 views

Cache policy not updated according to PageSpeed

I am trying to update my cache policy by adding some directives in the .htaccess file in the root of my website. Although I updated the values for javascript files to be 1 month, when using Google ...
0
votes
1answer
79 views

Why my WordPress Site Asking for HTTP Authentication?

currently i was working on a client website and when when ever i try to open wp-Admin page its displaying an authentication box.After discussing the current situation with hosting provider they ...
1
vote
1answer
37 views

Special domain for a page

I have a wp instalation on example.com and want to have secondary.com to show contents of example.com/b (b is a page) but keep secondary.com in the url (not secondary.com/b) I tried this approach: ...
3
votes
1answer
159 views

.htaccess rewrite rule for removing .php extension with exception of wp login and wp-admin

This is my current .htaccess: # Remove filename extension <IfModule mod_rewrite.c> # This will remove the .php extension if it is not a directory, the file does not exist and it's not a ...
1
vote
0answers
26 views

Some PDF files get Forbidden Access and other open normally on the same directory subsites

I have a WordPress multi-site with 4 subdomains. All PDFs in the main domain site work fine while on subdomain I get Forbidden access for certain PDFs. For instance when I open: http://example.com/...
0
votes
0answers
18 views

add_rewrite_rule query_vars NULL

Hello StackExchange folks. I don't have much experience with htaccess files, especially within WordPress, and trying to get a URL rewrite to work to fetch query values. add_filter( 'query_vars', '...
0
votes
0answers
22 views

execute cron jobs when .htaccess login protected?

My client is not able to execute cron-jobs in his wordpress dashboard because he gets 401 not authorized. This is because he has an .htacess file blocking normal access to the site (it's a member ...
1
vote
1answer
30 views

How to add new redirection on wordpress site

I have created new website https://example1.com/ and I have one old site https://example.com/. We have a customer support ticket portal and that portal URL is https://support.example.com/. Now I have ...
2
votes
1answer
30 views

htaccess and wordpress config files are regularly over written

I have a WordPress site (v5.2.3), and every now and again (possibly monthly) the wp-config.php and .htaccess files are over written with bad information. This results in two problems - first the DB ...
1
vote
0answers
42 views

What happens if I use .htaccess of network multisite on a single site installation?

If I use the .htaccess code given in network setup (subfolder version) on a single site installation, what problems could occur? I am testing this for a project so It's not pointless. I tested and I ...
1
vote
1answer
33 views

Setting custom search engine indexing for a “dynamic WordPress page” with htaccess

I am searching for hours but didnt found the code for my requirement, Can my requirement be done with htaccess? Requirement - These urls of a page should be indexed by Google: example.com/example-...
1
vote
1answer
85 views

Changing URL from /%postname%/%post_id to /%category%/%postname%/%post_id%

I want to add categories to my URL structure. I'm sure this has been covered and I found many resources online to create the redirect code in .htaccess, but when I enter the code it doesn't work. ...
0
votes
0answers
59 views

check if Url contains special character like #

I have site setup in wordpress as root folder like /wordpress and one angular site setup in sub folder /wordpress/angular. Currently if user visits url like mydomain.com/wordpress/sample-page, it ...
0
votes
0answers
30 views

All files in public_html, Cannot launch WordPress site via wp-admin

my registered URL is casualtyclaimscontainment.com I developed the site on AMPPS using the URL kriswebpg.test I uploaded site to https://dallas124.mysitehosted.com I have tried everything in my ...
1
vote
1answer
30 views

Add htaccess rules with insert_with_markers at beginning of htaccess

From my custom plugin, on activation, i want add some rules into htaccess but at beginning of the file. insert_with_markers add the rule at the end of htaccess, eg.: $lines = array(); $lines[] = '# ...
1
vote
1answer
27 views

Load time cost of using a redirect plugin v direct .htaccess entry

Occasionally, when I inherit a WordPress project developed by someone else, there is a plugin installed to do redirects. On my own projects, I enter all redirects directly into the .htaccess file. ...
1
vote
1answer
28 views

Htaccess redirect after changing Language URL format

After have changed the URL language format from http://my-site.com/name-of-page/?lang=en http://my-site.com/name-of-page/?lang=ru to http://my-site.com/en/name-of-page/ http://my-site.com/ru/name-...
1
vote
2answers
34 views

.htaccess file missing from Wordpress install directory

This is occuring on my local machine, Lubuntu 18.04 with apache2 and Php 7.2.15. Steps tried: Enable hidden files No .htaccess file seen: https://nimb.ws/4YJfDT Switch permalink structure to ...
1
vote
1answer
104 views

Why does the header set X-Robots-Tag apply to all pages?

The directives below are intended to apply the header X-Robots-Tag noindex and nofollow to a single page. The directives below are applied before the WordPress code block however it appears to ...
1
vote
1answer
26 views

Why does a directive only work when it is included inside WordPress directives?

The directive below is intended to block access to the thank you page. It appears below the WordPress directives. It does not work as intended in that the page remains accessible and does not display ...
0
votes
1answer
15 views

How To Use htaccess to Rewrite Link Structure for a Page that is Generated Programatcially

My site uses a plugin Easy Digital Downloads, which creates products that are of url structure, sitename/downloads/{Product} I want to change them to sitename/{product} For example, https://milyin....
0
votes
0answers
11 views

htaccess authentication on a Wordpress/Woocommerce site = trouble for users

To begin with, you should know that I'm a copy and paste guy. When it comes to regular expressions, to me it means someone isn't smiling or angry looking; they just have a regular expression. So, I ...