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
2
votes
2answers
17 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
0answers
13 views

Tagline is not showing in header [closed]

i have got internal server error so for this reason i had renamed the .htaccess file after that website is coming and everything is working fine but it is not showing the tagline in header i am using ...
0
votes
2answers
15 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 ...
2
votes
0answers
18 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
32 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
17 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
137 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
19 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
14 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
10 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
47 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
84 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
39 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
12 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
19 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
43 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
vote
1answer
53 views

Server (WordPress) redirects files that are not supposed to (using htaccess)

I use .htaccess to redirect some addresses or avoid some addresses to be redirected. Basically, I have all things redirected to another domain except for certain addresses that I specified. So example....
1
vote
1answer
74 views

Wildcard forward all posts and pages with few exceptions

I want to move my domain from example.com to example.dev and also set a wildcard forward. I use WordPress for blogging, now I want all posts and pages to be moved to the new address but I want some ...
1
vote
1answer
32 views

blocking access to all post/tag URIs via htaccess

I want to block all access to the post/tag/example-here pages on a WordPress site, but the following does not work. The .htaccess access file is being parsed. It is at the root of the site (ie the ...
0
votes
1answer
31 views

I want to resolve Redirect Chain [closed]

Anyone who can guide me in this matter, I want to resolve the redirect chain? http://www.example.com redirect to https://www.example.com and then redirect to https://example.com. I want to redirect ...
1
vote
2answers
38 views

Site searches by Python for non-existent assets

I've recently started paying greater attention to my 404 errors in order to clean up what I can and improve my site's SEO and ranking, and have noticed something that I don't understand. In my 404 ...
2
votes
2answers
43 views

Hacked website redirect, only on desktop, help with restoring it [closed]

This is my first post, I tried searching for similar problems, didn't find any that would fit my situation. Anyway. Recently my cousins website got hacked, I decided to take a look and try to fix it ...
1
vote
2answers
148 views

Deny access to a path (give 403 or 404 response)

I know this should be easy. BBpress creates user profiles at /forums/users/. I'd like to make them unavailable to anyone, and not be indexed by Google. I've tried the following (in .htaccess) and ...
0
votes
0answers
19 views

.htaccess to redirect to a wp page

My custom .htaccess commands are above the WP ones. This is working: <IfModule mod_rewrite.c> RewriteEngine On RewriteRule ^$ wp-content/ahoj.txt [N] </IfModule> It shows the contents of ...
0
votes
0answers
21 views

Wordpress pagination broken for page 2,3 with custom permalink. Redirects to baseurl

I have a forum installed with my Wordpress site. My pagination does not work and redirects pages 2,3, or more to baseurl when they are on homepage. Here are the settings: Forum baseurl: https://...
0
votes
1answer
60 views

Htaccess file reset automatically how to fix this issue

Often my WordPress htaccess file was reset am not able to find the root cause of this issue. But I guess this may happen when installing any plugin or manually take a complete backup of the site. Also,...
1
vote
1answer
42 views

Wordpress: Adding Security

Regarding this answer, is correct to add the file debug.log in this way? RewriteRule (?:debug|readme|license|changelog|-config|-sample)\.(?:php|md|txt|html|log?) - [R=404,NC,L] Kind Regards
1
vote
1answer
52 views

remove query arg from url after set query

i make migration plugin from specific script to wordpress, but i have a problem on redirect old urls to new one old urls is like book.php?view=12a34b56 and i want redirect it to book/12a34b56 i try to ...
4
votes
1answer
73 views

Name-based virtual host configuration in Apache seems to cause a “500 Internal Server Error”

I have the following problem: I made 10 WordPress sites for 1one client and now he needs me to configure the domains in his VPS. Based on some searches I did on the internet, the first thing I needed ...
0
votes
1answer
46 views

Clone WordPress for testing on localhost (with Fiddler)

My local setup for WordPress is at http://127.0.0.3/blog. When calling https://my.domain.name/blog/wp-login.php, I get the page served; including Google CAPTCHA. But the login post to a 302 redirect ...
0
votes
0answers
22 views

ErrorDocument 410 gives me back a 302 header

I've deleted several pages and tags from my site, and bases on my SEO recommendations I've redirected them to 410. I've done that in my .htaccess file this way: RewriteRule ^tag/lorem/?$ - [G] ...
1
vote
1answer
40 views

Redirect http to https does not work on subdir where another instance of WordPress installed

I have installed two instances of WordPress, on https://www.example.com/ and a subdirectory https://www.example.com/blogs/ Now to make all HTTP URLs be redirected to the HTTPS version, I add the ...
0
votes
0answers
22 views

PHP application in sub directory keeps redirecting to main site

I've got a PHP script which I have setup in a subdirectory (public_html/phpscript) but whenever I try to access it via www.example.com/phpscript I get redirected to the main site with a 404 page not ...
0
votes
1answer
60 views

URL rewrite for mu-plugin assets

I have a semi-bespoke scenario, but one that works best for out environment sharing the code workload and accessibility (and version control). We have a multisite that all abide by the same core ...
0
votes
0answers
31 views

Stop home page redirect to subfolder

I have a confusing issue! my home page redirect to subfolder! other pages are ok. just home page makes me confused. fidanfilm.ir .htacces on root is RewriteEngine On RewriteCond %{HTTPS} off ...
0
votes
0answers
22 views

Wordpress Multisite determine the correct domain to be set as current/default domain when setting multisite in Local fresh installation

I am unsuccessfully trying to setup multisite with Wordpress's fresh setup(Wordpress installed in subfolder under htdocs of Localhost), but existing copy of Database already imported(provided by ...
1
vote
1answer
16 views

How can I fetch the content of a post of my wordpress domain from an other domain?

I have my wordpress website, let's say wp.com, and an other domain, let's call it js.com. I would like to allow GET queries coming from the javascript client code of js.com to wp.com. Something like: ...
0
votes
1answer
97 views

How can I redirect users on the new 404 page without plugin?

I have a 404 page in my theme but I am not using that page. I have created a new 404 page in WordPress using wpbakery page builder. I need to know how can I redirect users on the new 404 page without ...
0
votes
1answer
61 views

How to fix URL with pageid example /?p= too many redirection error

I have recently updated my WordPress to 5.5 and I encountered "too many redirection error" when I use URL with page id /?p=1234 (previously it was working before the update). It keeps ...
0
votes
0answers
14 views

hide theme files for admin beneath root

The purpose is to give full admin rights, but not to the proprietary theme files. Our website is on /root/public_html/ We want to move only the themefolder /root/public_html/wp-content/themes/ beneath ...
0
votes
0answers
27 views

How do I Fix a Redirect Chain

I'm wondering how to minimize redirects and eliminate the chain from content that's being served both from https. 4 chains in total. All autooptimize cache related.
0
votes
0answers
35 views

Custom taxonomy shared across two custom post types - url rewrites

I'm using CPT-UI to create my custom post types and taxonomies. I have two post types - aulocations and uklocations these work and show up as: /au/locations/{location-names} /uk/locations/{location-...
1
vote
1answer
140 views

Remove special characters in a URL

I need a help to prevent special characters in URL & it should redirect to 404 error page, if anyone specifically entered characters. I tried a couple of ways through .htaccess but none of them ...
0
votes
0answers
13 views

Move root to subdomain and keep root

I have a pretty huge website in root folder of server and I want to move it to subdomain. The biggest issue is that I want to keep root wordpress for marketing purpose (wordpress will be stripped and ...
0
votes
0answers
18 views

Protect certain URLs from users that are not logged in

I'm trying to protect URLs like this on my website from being opened IF the user is not logged in. https://www.example.com/download/17719/ If a user tries to direct link to this and is not logged in, ...
1
vote
1answer
37 views

Fixing custom 404 pages broken by Wordpress in a subdirectory

I used Installatron to install Wordpress in a subdirectory of an existing PHP website, to add a blog to that website. My main website is administered via cPanel. Here's my website directory structure: ...
1
vote
0answers
171 views

Htaccess file isn't redirecting http sub-pages to https––they display 404 error instead, tried many solutions and none work

I installed SSL on my Google Compute Engine hosted WordPress Multisite installation, and have been having a hard time getting it working fully. Right now, the main domains for each site redirect ...
1
vote
1answer
19 views

How to redirect a page to another?

On my website, I have following url structure: example.com/test/ example.com/test/a-page example.com/test/another-page How can I redirect all of the URLS that contains /test/ right after the domain ...
1
vote
1answer
12 views

.htaccess edits

WordPress newbie here, apologies if things don't make sense. I bought a premium theme and uploaded/installed it to WordPress. Surely enough, after doing so, I found out that I was supposed to add the ...
1
vote
2answers
83 views

Call to undefined function insert_with_markers

I'm experimenting with creating a function to write code into htaccess (I understand the security issues associated). I'm currently using the function insert_with_markers() as a starting point however ...

1
2 3 4 5
25