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
0answers
10 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
13 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
votes
0answers
24 views

How to redirect URL with string query to the same URL without string query? [on hold]

There are 2 websites. https://example1.com and https://www.example2.com The following URLs should redirect to the desired path. (Example URLs) This is the original URL (of the 1st website) https://...
1
vote
1answer
23 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
19 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
26 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
31 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-...
0
votes
1answer
55 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
19 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
24 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
14 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
25 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
22 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
22 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
39 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
23 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
14 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 ...
1
vote
1answer
25 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
19 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
26 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 ...
0
votes
0answers
50 views

Rewrite for Posttype

i want my posttypes url structure to be /brand/trailer/ instead of /trailer/. I'm not sure how to do this function anhaenger_rewrite() { add_rewrite_rule( 'trailer', 'brand/trailer', ...
1
vote
0answers
205 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
23 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
22 views

Content Security Policy limitations with WordPress core

The following Content Security Policy is intended to restrict the entities that are permitted to interact with a given site. It appears that WordPress core utilizes various eval() functions as well as ...
0
votes
0answers
14 views

.htaccess for migration blog.domain.com to domain.com/blog

I'm interested in migrating blog.domain.com to domain.com/blog and kill the subdomain. I'm thinking of using .htaccess and then a search/replace plugin for all the images and links that were hardcoded....
0
votes
0answers
21 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
44 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
30 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
25 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
18 views

Adding a subdomain to a wordpress site

I have a wordpress site but I want to have subdomains that will redirect to dir <IfModule mod_rewrite.c> RewriteEngine On RewriteBase / RewriteRule ^index\.php$ - [L] RewriteCond %{...
0
votes
0answers
32 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
65 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
35 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
0answers
31 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
78 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
16 views

Redirection issue

I run intro problems with my redirection. I got two domains casparpreservers.eu and caspar-labs.com. My problem is: Casparpreservers.eu should redirect all former posts so caspar-labs.com. E.g. ...
0
votes
0answers
39 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 ...
0
votes
0answers
21 views

Multisite Wordpress Redirect

I have Wordpress running on a server running Apache 2.4 (wordpress). Wordpress is running on port 8080. We have a proxy back to Wordpress going from port 80 (proxy:80) to 8080 (wordpress:8080) on a ...
1
vote
1answer
41 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 ...
0
votes
1answer
36 views

How do I do a redirect to WordPress permalink with post id via htaccess?

Years ago I saw Jeff Starr of Perishable Press set up shortlinks for a book of his where URLs such as example.com/u/123 redirected to example.com?p=123. I thought that was a handy way to set up no-...
0
votes
1answer
27 views

How to rewrite wordpress search to work on specific category

I want my wordpress search to work on specific category within custom search, by default this actually work fine example.com/categoryname/?s=keyword but I want to make it work like this example.com/...
0
votes
0answers
25 views

How to hide subfolder of static pages in Wordpress using htaccess

I need help please because I cannot find a solution for my problem. I need to hide a subfolder in the url of my wordpress site. I created a subfolder where I uploaded some static pages in php ...
0
votes
0answers
26 views

Help with .htaccess setup to hide WordPress Directory

I have a WordPress site that is installed in a directory called cms. I will be using a pure HTML page as my Home page, the inner pages will be using WordPress. Let's call the website mysite.com ...
1
vote
1answer
44 views

htaccess file for multiple CMS's (multisite wordpress + wolfcms) on same domain but different subdirectories

Thanks for reading this! The website I am building is used for an annual symposium that is held since 2003. All those website are still online and should remain online. From the year 2003 till the ...
0
votes
0answers
46 views

htaccess redirect to path

I'm trying to get my site to redirect to a certain folder depending on a condition. This condition cannot be done within WP, so... Anyway.. I've done conditions before, but I keep hitting a wall ...
0
votes
3answers
25 views

Increase .htaccess file upload without prompting error

I have a Centos Web Panel hosting and a new WordPress file. I wanted to migrate all of my local WordPress files to the live server so I installed All-in-one WP Migration. Unfortunately it can only ...
0
votes
1answer
27 views

wp-admin and wp-login.php not Accessible after Cloudflare

I have the following .htaccess rule to limit access to wp-admin and wp-login.php locally via SSH dynamic forwarding: Order Deny,Allow Deny from all Allow from 127.0.0.1 However, after installing ...
0
votes
0answers
110 views

WP Migrate DB Pro plugin cannot transfer Media files to remote server

I'm using Delicious Brain's WP Migrate DB Pro plugin to migrate database tables and to transfer Media files (add-on) from my local virtual machine to my remote server (provided by GoDaddy) This ...