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
1
vote
1answer
147 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
47 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
15 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
718 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
67 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
25 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
68 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
648 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
15 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
217 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 ...
2
votes
0answers
169 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
51 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
65 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
18 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
300 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
43 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
629 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
243 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
132 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
34 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
54 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
109 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
38 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-...
2
votes
1answer
577 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
467 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
44 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
101 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
31 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
165 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
618 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
329 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
42 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
58 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....
1
vote
1answer
1k views

Rewrite rule to load images from production does nothing

I'm trying to adapt the rewrite rule given in Develop Locally, Use Images from Production to do the very same thing on my local dev site (which runs on XAMPP). This is how the development site's ....
1
vote
1answer
472 views

I can't access the admin panel links as I click it shows 403 error

I am working on the following website. when I login into the Dashboard and click on any item on admin panel such as post or pages I get the following error: You don't have permission to access /wp-...
0
votes
0answers
45 views

Cannot publish posts or pages when I change permalink structure

I changed the permalink structure to be just /%postname%/ without the index.php, I've added the required lines to the .htaccess file, Allowed override in the httpd.conf but it still doesn't work. ...
0
votes
0answers
21 views

Update htaccess in several WP sites at once

I make changes to htaccess file quite often and having several sites to manage, I have to update every htaccess file in every site. I was wondering how to automate this task... I was thinking about ...
2
votes
1answer
6k views

403 Forbidden - You don't have permission to access /wp-admin/admin-ajax.php on this server

When I try to make a backup of my wordpress website through plugin I recieve the following error: "403 Forbidden - You don't have permission to access /wp-admin/admin-ajax.php on this server." This ...
1
vote
1answer
24 views

WordPress Sub domain

I installed WordPress on sub domain and I have Permalinks as domain/subdomain.com. In this way this website is working correctly and the main website is accessible via subdomain.domain.com as well ...
0
votes
0answers
94 views

WP Multi Site - configure Sub domain pointing to parent sub directory

I've a purchased a hosting plan from hostinger, but it seems they don't provide wild card subdomains. Now I want to set up a multisite wp on hostinger in a subdomain format, not sub directories. When ...
1
vote
1answer
80 views

Remove /sites/25/ from image URLS

I am running multisite with subdomains. I'd like to manipulate the image path for the "espanol" subdomain only. Here is the current image path (example): https://espanol.xxx.xx.xx.xxx.xip.io/wp-...
0
votes
1answer
165 views

Redirect Wordpress site to a landing (construction) page using htaccess, with access to /wp-admin and /invoice

I have tried everything I know and I can't seem to come up with a solution. I am trying to redirect my website to a landing page (which I have put into a folder with a css file, changing the index....
0
votes
0answers
38 views

I need to make one folder private

I'd like to make one specific folder in WordPress private and give access permission only for the administrator role. What I can do for now is to make the folder private by .htaccess and give access ...
0
votes
0answers
53 views

301 Redirect in Wordpress not working in htaccess

I've tried multiple blocks of code and none of them work, i.e.: RewriteEngine on Options +FollowSymLinks RewriteEngine on RewriteRule (.*) http://www.newdomain.com/$1 [R=301,L] and RewriteCond %{...
0
votes
0answers
101 views

Problem to redirect custom page using htaccess

I could not create dynamic post through URL by .htaccess, Page or Post redirect automatically 404 page. I have tried Redirection Plugin, but i could not successfully redirect. Please try to give ...
0
votes
1answer
231 views

Using htaccess to prevent spam through wp-comments-post.php

I have a lot of spam comments being posted on my WordPress site. It is being posted using the wp-comments-post.php file. I can see from the logs: "POST /wp/wp-comments-post.php HTTP/1.0" 302 3744 "...
0
votes
1answer
59 views

How to create multiple Rewrite-Rule for various site in single htaccess?

I am using a single database for two different sites. One is sitejury.com and the other is cdn1.sitejury.com. I'm trying to serve my files using the subdomain. Previously I used simple https Rewrite ...
0
votes
1answer
213 views

WordPress add_query_arg from ajax and make url friendly

In WordPress I have set a query arg in ajax like this add_action( 'wp_ajax_get_prepare_link', 'prepare_link'); add_action( 'wp_ajax_nopriv_get_prepare_link', 'prepare_link'); function prepare_link()...
0
votes
0answers
446 views

Pages in wp-admin is not found 404

I moved my website from localhost to web server. The website works fine. When I explore any page the urls on the website(front-end) are working fine so permalinks are not a problem. Issue is when I ...
2
votes
1answer
710 views

Redirect from different port to subdomain - htaccess

I created a Digital Ocean instance to install WordPress website 5 days ago. I already have my own domain, and created DNS Subdomain blog.example.com. The server runs both nginx and apache so my Apache ...

1 2
3
4 5
24