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

Sub domain URL slash / missing after domain and before Post & page slug

WordPress page/page is not working after moved the file to subdirectory. URL structure domain.com/subdirectory/post1 is loading as domain.com/subdirectorypost1 - slash (/) is missing before post/page ...
1
vote
1answer
28 views

browser caching not disabled after disabling in .htaccess

I am having a strange problem in one of my wordpress websites. The problem is that when a webpage is rendered once, editing that page won't be effected afterwards. So no matter how many times you ...
0
votes
0answers
11 views

How to change the site directory to the directory of another site in VestaCP?

How to change the site directory to another site directory in VestaCP? As a result, another site should show files from another site
0
votes
0answers
6 views

need.htaccess 301 redirect code for any pages starting with //www.example.com to home page of //example.com

I would like to add an one catches all .htaccess 301 redirect code for any (old)url starting with https://www.example.com to the home page of https://example.com. (without www.) The permalinks are not ...
0
votes
3answers
15 views

wp-admin going directly to 404

Recently, I was having an issue with all wp-admin pages. I was able to login and see the dashboard, but every time I went to another admin page I would get a 404. So after some searching, I started ...
0
votes
0answers
15 views

Using .htaccess for temporary redirects while updating live site

Apparently there are nocache rules that can be added to .htaccess for temporary redirects, such as while updating a live WP site. In researching a difficulty with my browser getting "stuck" ...
0
votes
0answers
19 views

Capturing variable after slash in domain

I'm developing an ecommerce website with Wordpress / Shopify API. I'd like to be able to capture discount codes through the URL. So if the discount code was code40, I'd like the enduser to be able to ...
0
votes
0answers
26 views

Problem with Wordpress permalinks

We have set our permalinks so that it displays like this: example.com/iphones/ for categories and example.com/iphones/iphone-11-Pro for the products. The problem that the old native URLs of ...
2
votes
1answer
21 views

Redirect “any page/page/number/” to “any page”

I've read so many similar topics but none of them matches my own request. I'd like to redirect in ht.access any page with pagination to the root-main-original page. example.com/garden/page/2 ...
1
vote
1answer
24 views

Double domain name in category URL-s

My site runs on the latest version of WordPress. However, I have a problem with categories. Permalinks are set correctly and my category path looks like this: example.com/category-name. Links work ...
0
votes
1answer
57 views

Redirect specific URL before other redirects take place in .htaccess?

The canonical website URL will be https://www.example.com Typically any requests eg for https://example.com will be redirected to https://www.example.com by WordPress site settings. However, I have a ...
2
votes
1answer
37 views

How to exclude a directory from WordPress permalinks in a Multisite environment?

The scenario is as follows: A multisite install with three sites: site1.com (admin) site2.com site3.com Q: How to exclude a folder located in the root directory, which should also be associated with ...
1
vote
1answer
17 views

htaccess redirect - replace special character

In my previous post, I asked about how to 301 redirect all .com/language/X URLs to .com/members/?members_search=X using htaccess. Thankfully I got help, and the solution was RewriteRule ^language/(.*)...
0
votes
0answers
14 views

whenever I am visiting to subdomain it keeps redirecting to Main domain

I have created a Subdomain and installed wordpress on it, I have also deleted .htaccess file from subdomain directory. but it keeps redirecting to main domain. i have also added these line to Wp-...
2
votes
0answers
38 views

Block only external access to wp-cron.php on OpenLiteSpeed

I use OpenLitespeed server with multiple Wordpress installation and want to restrict external access to some files, only allowing server itself to access them (for example to call cron), so: What I ...
1
vote
1answer
28 views

htaccess redirect not working

I'd like to 301 redirect all .com/language/X URLs to .com/members/?members_search=X. Test case: http://example.com/language/french should 301 redirect to http://example.com/members/?members_search=...
1
vote
1answer
51 views

.htaccess rules for blocking bots with an extra condition

I have a WP multisite installed. I am integrated with Ezoic and Cloudflare. I had implemented firewall rules. However, I have an issue blocking bots that have X-Middleton in the User-Agent, because my ...
0
votes
0answers
20 views

Mysterious site access error

I'm a bit stumped because of a weird access problem of a WordPress site. The site is on the main corporate domain, and recently, the client has had office365/active directory installed for his network....
2
votes
2answers
28 views

.htaccess redirects disappeared after re-saving permalinks

I want my WordPress website to load with https + non-www and without trailing slashes. I put the following code in .htaccess file: <IfModule mod_rewrite.c> RewriteEngine On # Remove trailing ...
1
vote
1answer
17 views

Access files at new location using old file paths

I have a bunch of posts that contain images with urls that follow this pattern: https://example.com/example_directory/files/2019/04/file.png I've imported the posts into a new install of wordpress on ...
1
vote
1answer
120 views

When is it necessary to have Header unset Vary in .htaccess

I just did a major update in my WordPress environment tonight to the latest version, and got an internal server error on the site. I then did a full inspection to see where the issue was coming from. ...
1
vote
1answer
29 views

SSL and www to non-www redirection works only on homepage - Wordpress

I've enabled SSL on my Wordpress website and set redirection from www to non-WWW via the following code placed in .htaccess: # REDIRECT WWW TO NON-WWW RewriteEngine on RewriteCond %{HTTP_HOST} ^www\....
1
vote
1answer
33 views

How to remove wordpress directory slash

I have installed a website in my domain directory like example.com/website. The main issue or problem is that it redirects me to example.com/website/. I never want redirection and I just want that my ...
1
vote
0answers
18 views

Wrong Redirect/Rewrite Rules?

i'm a total newbie to rewrite and redirect rules and i have some strange problems on my multisite. when i try to open www.my-website.com/blog or www.my-website.com/xmas for example, in safari browser ...
0
votes
1answer
79 views

Strange behavior: random HTTP error 500 fixed by visiting Permalinks settings page (htaccess issue with language code)

I’ve got a pretty weird behavior on my site that I’d like to resolve. From time to time (no recognized pattern), my site shows a 500 error, on the front pages or on some admin pages. When this 500 ...
1
vote
1answer
43 views

Remove / from www.example.com/ [closed]

Whenever I type my domain, example: www.example.com there is a forward slash that automatically appears in Firefox. Example: www.example.com/ How can I remove this?
1
vote
1answer
76 views

Issue with htaccess redirection in WP Multisite

My site structure is main site example.com and two subfolders sites /es/ and /en/ example.com redirects => example.com/es/ and example.com/en/ is the English version. What is wrong? The following: ...
1
vote
1answer
23 views

Custom permalinks in Wordpress

I have a question about permalinks that has me crazy because I have not found a solution for a long time 🙁 So I turn to the wisdom of the hive mind to see if it sheds some light on me. I have my ...
2
votes
1answer
39 views

Protect Upload Folder Files With Ampersand Problem

Wondering if anyone can help with this problem. I have been able to get file protection working in WordPress with the method below: .htaccess RewriteCond %{REQUEST_FILENAME} -s RewriteRule ^wp-...
1
vote
0answers
42 views

Cannot access wp-admin without trailing slash - .htaccess configuration for Wordpress behind a nginx proxy

I have a WordPress instance running via http-proxy-middleware, so I can have my WordPress blog under example.com/blog The problem I'm struggling with is I cannot configure the .htaccess file properly. ...
0
votes
0answers
28 views

Rewrite htacess rule doesn't work

Inside the page directory I have multiple pages such as admin-add-account, registration, and I'm trying to rename them from www.example.com/page/admin-add-account.php to www.example.com/admin-add-...
1
vote
0answers
40 views

Was told to change the .htacess file form .html to .php so this would work properly

My video landing page shows up fine on the computer that the video and landing page where edited on. The VSL shows up fine on a link sent from my computer but when I go to play the video it goes dark....
1
vote
1answer
24 views

Wordpress 404 in development area

I have a live WP site, which I have taken a copy of and put onto a new server for testing / development. Once I put the website on the new area I updated the site url and home url in the database, ...
1
vote
0answers
14 views

Changed pagination URLS to use p= instead of paged=

I am trying to rewrite my pagination URLs to use p instead of paged so they go from... example.com/myposts?paged=2 to example.com/myposts?p=2 How is the best way to do this? Do I need to use the ...
1
vote
1answer
33 views

Rule to redirect non logged in User to Custom Registration/login Page in .htaccess file

I am trying to redirect not logged in users from the "/purchaseads/purchase.php" to custom registration/login url "/purchaseads/registrationurl"on wordpress website. Unfortunately ...
2
votes
2answers
32 views

How have I misconfigured basic auth for my wordpress site?

I've installed Wordpress on a bare Ubuntu20-04 box following Digital Ocean's guide. Now I want to password protect the entire site but as I can't find any plugins that protect uploaded files and ...
0
votes
2answers
19 views

website is not loading home page (moving from one server to another server)

I have a wordpress site and i want same site with other domain name at same server. I moved all files and folders to new domains directory and also successfully moved database. My admin panel is ...
3
votes
0answers
60 views

Sub-subdomain getting redirected to main domain

I'm working on a multisite network. I intend to make it a subdomain based network but cant seem to make it work because of the redirects. The main multisite network resides under app.trainergoesonline....
1
vote
3answers
35 views

How to fix category url 404's after category permalink change

I am working on SEO for a website. So, I wanted to append "-coupon-codes" to all category URLs. My Category Base Slug is : stores Example what I wanted to achieve redirection : /stores/...
0
votes
0answers
27 views

Remove language slug to a path in a cloaking url

I have created a cloaking url, but I have a problem, I am using a translation plugin called translatepress. When I change the language the cloacking url changes from mysite.com/refer to mysite.com/es/...
1
vote
1answer
1k views

How can I set Cache TTL for woff and woff2 font files with htaccess?

My WordPress site htaccess file currently has these entries to set cache expiry for woff and woff2 font files: <IfModule mod_expires.c> # Content type AddType application/font-woff .woff ...
1
vote
1answer
20 views

Site in subfolder - all pages work except home

Our WordPress site is in a subfolder /subwp/, and all pages except the home page work. This is the root folder: <IfModule mod_rewrite.c> RewriteEngine On RewriteBase /subwp/ RewriteRule ^index\....
0
votes
0answers
15 views

Xampp is not loading media

I duplicated my wordpress website from hosting to localhost using xampp. I copied the database and the web files as in the real web. The problem is that when I connect with the web in localhost the ...
0
votes
0answers
11 views

How to fix URL segment conflict from page and post type URL?

I have two different pages like, 1 :- http://example.com/notebook/note-name-x/ // Real Page 2 :- http://example.com/resource/note-description-x/ // Created by post type Then i have changed second ...
2
votes
2answers
318 views

Which HTTP headers to use for subdomain <iframe> embedding?

I have a Wordpress site hosted on LightSail (which uses bitnami). The domain is https://example.com On a subdomain https://sub.example.com I have another server running. On this server, I want to ...
0
votes
0answers
234 views

Wordpress /wp-admin redirect to wrong port in docker

While installing an existing Wordpress installation in a docker container, I've been unable to access the wp-admin pages. The site and pages load perfectly but when browsing to https://example.com/wp-...
1
vote
1answer
54 views

Redirect main domain to subdirectory

Following the following code sample I managed to redirect it, however the site URL on the browser show as domain.com/subdirectory and not domain.com. public_html ROOT .htaccess RewriteEngine on ...
0
votes
0answers
13 views

rewrite .htaccess on wordpress to subdirectory

I have wordpress installation on root site folder. Then I will need to pointing some url to set to subfolder. wp-admin wp-content wp-includes subfolder ....etc When user access some url like below: /...
1
vote
1answer
21 views

Need Help Correct Regular Expression Redirect Code

I have custom permalinks with this code /%year%/%monthnum%/%postname%.html and now switching to another custom permalinks %postname%.html so obviously all my content is now 404 not found, in yoast ...
1
vote
1answer
103 views

Restrict uploaded files into a custom folder to logged in users by htaccess: looking for Nginx - not only Apache - solution

Talking about this well known solution: Github Original discussion I'm looking for a straightforward way working also on a Nginx installed WP and not only on Apache ones. Is there any other code-based ...

1
2 3 4 5
25