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

Redirect to new domain with .htaccess [closed]

I am changing the domain of my website. But, I am struggling with the domain redirection. I need to implement this wildcard redirection. So that I visit. https://www.oldomain.com/page1 It should ...
1
vote
2answers
39 views

Redirecting old post url to 404 in wordpress using htaccess

In WordPress I have a post with URL https://www.example.com/article.html. I renamed its permalink to https://www.example.com/article-new.html. Now if I open the old URL https://www.example.com/...
0
votes
1answer
8 views

Error in /blog redirection - ubuntu default WP installation

I have installed WP from the Ubuntu repositories (18.04) and the domain I got was something like http://snf-XXXXX.vm.okeanos.grnet.gr/blog (notice the blog at the end). After some tries to perform a ...
2
votes
2answers
74 views

Add query string to url and display it as normal url part /folder/

I have a query string added to some urls which isn't pretty: ?city=Amsterdam So i'd like to structure the url like: https://example.com/realpage1/realpage2/amsterdam/ or https://example.com/...
1
vote
0answers
18 views

want to rewrite an URL in wordpress

i want rewrite some urls in wordpress from http://localhost/wordpress/my-page/2/ to http://localhost/wordpress/my-page/part-2/ anyone can help? Now i am using something like this but it not working....
1
vote
2answers
34 views

redirect the homepage using .htaccess outside of WordPress

For a marketing reason, my client needs a standalone HTML Page as the "temporary homepage" What I would like to do is redirect the homepage to a page OUTSIDE of the WordPress ecosystem - I guess ...
0
votes
1answer
18 views

On the online version of my blog posts disappear

I lose posts after a few weeks. So as of today there is a gap form April 14 to March 17. Do you know what happens. how can i rectify it? And then there is a gap
0
votes
0answers
12 views

Rewrite rule not working, but only when parameter is text

I have a simple rewrite rule that changes something like /locations/?slug=times-square to /locations/times-square/. The same "location" can be retrieved by ID, so the following URL's all work and ...
1
vote
1answer
20 views

Giving to wordpress it's own directory cause login loop

I have done a fresh wordpress installation from a subdirectory. I've followed the official wordpress guide to give wordpress it's own directory, but now I have a login loop problem, I'm not able to ...
1
vote
1answer
11 views

htaccess wildcard redirect misses some URLs

I am using a wildcard redirect to redirect my old domain to a new domain. It works great but misses a few URLs (they don't get redirected to the destination and return status 200) Can you please help ...
0
votes
0answers
23 views

Redirect files in uploads directory if WordPress user not logged in

I would like to redirect all of the following urls if a WordPress user is not logged in (or WordPress cookie is set) using .htaccess. https://example.com/wp-content/uploads/sample_pdf https://...
0
votes
0answers
29 views

domain redirection is not working from old to new

I have 2 domains running in parallel say abc.com and xyz.com. Here our company has decided to change the abc.com to some new branding xyz.com. so for that we have taken the entire content from the abc....
2
votes
1answer
31 views

Remove File Extension for Page Outside of WordPress

I need to add a plaintext page to my server that is outside of WordPress (it can't have any HTML on it). I created the page off of public_html, but I have to add a .html extension to get the page to ...
2
votes
1answer
25 views

Temporary .htaccess blocking is disabling WP Crons from running?

I'm currently working on a production site where htaccess is blocking users that do not have my IP from accessing the site: RewriteEngine On RewriteCond %{REMOTE_ADDR} !^11.22.33.44 RewriteCond %{...
1
vote
1answer
68 views

How to rewrite URL with PHP variables with htaccess to a normal looking URL?

I want to change an old database website that is not made in WordPress to WordPress. My site uses PHP variables so the URL is originally: example.com/index.php?tl=1&pg=2&bs=3&hcbs=4&...
0
votes
1answer
20 views

Internal Server Errors - Moving working multi-site install to my localhost

So I keep bumping into server errors and I can't seem to spot where the issue is stemming from. I am able to log in to my admin panel but the redirects keep creating errors. Not sure if the issue ...
1
vote
0answers
7 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
9 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
50 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
28 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
54 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&...
0
votes
0answers
15 views

Apache errors for blog with separate TLD, in WP multisite which is itself is in a subdirectory

I have a working Wordpress multisite subdirectory installation, which itself resides in a subdirectory on the server, so that the directory structure looks like this: http://domain.tld/ --> some ...
1
vote
1answer
65 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
11 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
176 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
31 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
107 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/...
0
votes
0answers
10 views

Redirect from /sub-directory/old-page to /new-page Wordpress [duplicate]

I have a new website set up (same domain, new server, new Wordpress set up) and one of the old pages has a different url to the new page. The previous set up was: mywebsite.com/sub-directory/old-page ...
1
vote
1answer
27 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
24 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
44 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
150 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
291 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
58 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
16 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
599 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
14 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
90 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 ...
0
votes
0answers
84 views

My site working fine via mobile internet but Problem in WiFi internet

I have a site on WordPress like https://www.fileour.com. Now I have confirmed. My site is problem only in WiFi network around in only on full Bangladesh. But everything is fine through any mobile ...
1
vote
1answer
22 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
17 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
38 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
125 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
26 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
84 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
60 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
50 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
93 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
2 3 4 5
23