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
1answer
8 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
29 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
30 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
8 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
17 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
31 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
51 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
68 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
28 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
24 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
29 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
37 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
91 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
19 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
39 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
39 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
36 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
48 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
43 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
19 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
38 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
52 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
30 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
14 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
48 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
45 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
18 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
60 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
12 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
16 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
33 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
97 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
10 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
66 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 ...
0
votes
0answers
16 views

Redirect default pagination page to template page's pagination

How do I redirect the default pagination pages such as http://mywebsite.com/page/2 to a template page so it looks like http://mywebsite.com/articles/page/2 articles is a custom template page and not a ...
-1
votes
1answer
49 views

Where is the htaccess in wordpress.com hosting?

I am looking to upload a htaccess file or amend the existing htaccess, assuming there is one being used by WordPress. All i want to achieve is denying access to my WordPress site and allow specific ...
0
votes
1answer
410 views

Password protect directory but not files

I'm running a WP+WOO site for a client and thought that a simple way to secure the admin login area would be to password protect it. The problem is that sometimes (especially on WooCommerce pages) ...
0
votes
0answers
23 views

How To Change a Search Submit URL

how should i change this url: http://127.0.0.1/infobd/new-info/?keyword=hope To this URL http://127.0.0.1/infobd/new-info/hope using .htaccess or add_rewrite_rule it's a search submit URL on WordPress ...
0
votes
2answers
30 views

Force a 403 response to xml file in Wordpress

I'm looking to force a 403 access denied response for an xml file in a directory outside of the default Wordpress install. The url I'm trying to force the 403 response on looks like this mydomain.com/...
0
votes
2answers
32 views

How to forward all requests starting with a specific folder name to the same folder

In my Wordpress website main directory, I created a folder servers, which contains two files .htaccess & index.php. In the .htaccess file, I add those lines to redirect all requests to that folder ...
0
votes
1answer
36 views

301 redirect any RSS feed on level up url

On my site I've got RSS feeds - something like this: www.example.com/en/shipper/feed/ www.example.com/en/carrier/feed/ I want to 301 redirect all those URLs to the level up, respectively: www....
0
votes
1answer
24 views

Woocommerce posts and products links works only once and then get 404 error

Permalink to products and post of my website getting 404 error. after saving the permalink type in Setting -> Permalink page they will work correctly. But if I refresh the links they get 404 error ...
0
votes
1answer
15 views

How do I write a subdomain redirect?

I'm trying to write a redirect so that anyone who tries visiting "www.example.au" is directed to "www.example.com", but I'm not sure how to do that in my .htaccess file. So far, I'...
1
vote
1answer
76 views

Wordpress rewrite rules don't need ^?

For example this code class My_Sitemap { public static function install() { add_filter('rewrite_rules_array', array(__CLASS__, 'rewriteRules'), 1, 1); global $wp_rewrite; ...

1
2 3 4 5
24