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
0answers
9 views

Redirect all requested url to new url

i want to redirect all requested url in wordpress to new url, for example : domain.com/c/camera to domain.com/product-category/camera How can I do this in htaccess?
1
vote
0answers
19 views

301 redirection editing .htaccess doesn't work

I set up SSL certificate and submitted to the hosting service. It says it is connected to Port. I wanted to redirect http url to https, so I edited .htaccess file with a code as below in the root ...
0
votes
0answers
368 views

Deny,Allow on .htaccess isn't working

i'm trying to deny all access to wp-login php and grant access to specified public addresses but it only block everyone whitout granting the specified addresses access this the config used <...
0
votes
0answers
30 views

Got 404 error when changed siteurl via DB in Wordpress

The problem is that I have changed the wp_options table with site URL and home fields from http://localhost/WordPress to http://localhost/test I get 404 errors or Object not found error. What I ...
0
votes
0answers
201 views

Should I prevent access to .htaccess and wp-config.php files?

Someone at stackoverflow suggested I should deny access to the two files by doing below in .htaccess. <files ~ "^.*\.([Hh][Tt][Aa])"> order allow,deny deny from all satisfy all </files&...
1
vote
1answer
531 views

htaccess modify headers IF url ends with "news"

I have a wordress page that resolves to /mysite/news and I'm trying to load it onto another site using javascript. This is a natural cors violation so I'm setting cors to * to bypass the issue ONLY if ...
0
votes
0answers
17 views

WordPress not linking correctly with .htaccess redirect to subdirectory

I have read other posts about redirect to subdirectory issues, but they don't answer this precise question. I would like to redirect the main domain name in a hosting account into a subdirectory. The ...
0
votes
2answers
461 views

Strange behaviour of is_user_logged_in() and get_current_user_id()

I have an issue where is_user_logged_in() appears to alternate between being true and false. Additionally, get_current_user_id() gives the correct user ID if is_user_logged_in() is true. Here's my ...
0
votes
2answers
135 views

How to redirect an old page url to the homepage

I deleted a post from a site and I used yoast to move the URL (error 301) to another post, now I am struggling because I want to move the deleted content to the site homepage instead of blog post. ...
0
votes
1answer
783 views

Seo Friendly Filter URLs

Is it possible to create more SEO friendly filter URLS? Instead of: https://thejewelleryroom.com/product-category/rings/?filter_material=gold Then: https://thejewelleryroom.com/product-category/...
1
vote
1answer
670 views

Redirect from sub-directory to root - New Wordpress 5.2.3 Set up

I am using Wordpress 5.2.3 for a new website on a new server set up. I have pointed the existing domain at the new server. The old website was installed on a sub-directory. So Google etc. has ...
1
vote
1answer
46 views

Can't upload .htaccess after editing in notepad

Switching site from http to https, but in .htaccess I can't upload file successfully after adding RewriteEngine On RewriteCond %{HTTPS} !=on RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=...
1
vote
1answer
121 views

Redirect custom post type from one domain to another domain

There is a custom post type by the name of code parked on a domain: sample.com. The redirect of the whole custom posts of code CPT to the custom posts of code CPT of www.someanotherdomain.com ....
1
vote
0answers
795 views

htaccess working on local server but not on live server

My htaccess file, below, works fine on my local development server (AMPPS on Mac) but not on my live server (which is through Cloudways). # BEGIN WordPress <IfModule mod_rewrite.c> ...
1
vote
1answer
1k views

Case insensitive header params for API request

I am making API requests with token based Auth mechanism. Here is example request. TokenRequest({ method: 'POST', url: {URL HERE}, headers: {'Authorization': Bearer {token}}, ...
0
votes
0answers
204 views

Translatepress taxonomy and custom post type root FIX

I'm using Translatepress. Great plugin, one exception: they haven't developed translation for taxonomies and custom post type root slugs. Does anyone know how to achieve this? Some .htaccess magic ...
0
votes
1answer
34 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
631 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
90 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
678 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
28 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 ...
1
vote
1answer
49 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
22 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
58 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
1k 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
28 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
125 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
28 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
88 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
122 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
297 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
64 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
2k 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
171 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
26 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
166 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
1k 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
16 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
1answer
456 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
244 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 ... ...
1
vote
1answer
131 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
23 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
508 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
50 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
1k 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
678 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
265 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
37 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
93 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 2 3
4
5
26