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

WordPress Multisite's in subdirectory not redirecting to dashboard settings

I am not sure what's happened but our WordPress multisite that's been in a subdirectory for the longest time now refuses to redirect to the WPMS dashboard pages. Settings, themes, plugins etc. All the ...
1
vote
0answers
32 views

What to write in the htaccess in order to detect browser language and point accordingly?

On short: I use Polylang plugin for my web but it's option to detect browser language won't work because I need to use cache in the whole site, including the homepage. I have a bilingual website (...
1
vote
1answer
28 views

Use virtual pages point to one specific page

How should I approach this issue? I want to create one page, but many "virtual pages", e.g. like a productinfo.php. A product has several. In this case you manually create the posts in the ...
1
vote
1answer
21 views

Wordpress category page redirects in .htaccess not working

Wordpress automatically generates category pages, for example: https://planthardware.com/category/microgreens/recommended-equipment/ I want to redirect this to a custom page, for example: https://...
0
votes
1answer
24 views

Wordpress is adding "category" word before my actual category name in url (and this is unsolicited)

Check out this image: This is twenty twenty theme, a default theme. I started facing the problem with a non-default theme, so I switched over to this other theme just for testing, same thing. What's ...
0
votes
0answers
25 views

Add a parameter at the end of the url and prettify

I have created a plugin with a shortcode that renders the results to a list of items. The plugin is programmed in Vuejs so the shortcode does not have any type of parameter. The fact is that I go to ...
1
vote
1answer
30 views

set up 301 redirect within wp-content/uploads/ directory of a WP site to a new image URL

I need to do a redirect within wp-content/uploads/ - to a new image name, because the old one doesn't work. How do you do this? I want to redirect from https://example.com/wp-content/uploads/2021/09/...
1
vote
1answer
19 views

add_rewrite_rule fro html to another url not working

I want to redirect mywebsite.com/anyname.html to mywebsite.com/product/anyname For that I write the following query in functions.php . But it is not working . Please see my code below function ...
2
votes
0answers
40 views

Giving WordPress its own subdirectory - nginx

I want to move WordPress installation to a subdirectory without affecting site url - https://wordpress.org/support/article/giving-wordpress-its-own-directory/ (method 1) The article contains only ...
1
vote
1answer
30 views

Redirect parent taxonomy to it's child

I am trying to redirect this url/investments/state/city/ to this url/investments/city/ custom post investments taxonomy structure: state 1 city 1 city 2 and so on. Any elegant solution?
1
vote
1answer
158 views

How To Allow Only Specific User Agent To Access a URL?

Suppose this is my URL: https://www.mrskt.com/sitemap_index.xml I want to only allow specific user agents. I mean only search bots like Google, Bing, Ahrefs, etc. can access that URL. No other user ...
0
votes
0answers
16 views

www redirects to another directory in wordpress

I am using Really Simple SSL plugin but I just noticed that whenever I type the www.ozaro.com/mozaro it automatically redirects to ozaro.com not ozaro.com/mozaro So please help
2
votes
1answer
25 views

How to create a 301 redirect that doesn't apply to subsites

Scenario: I'm trying to set a 301 redirect so that https://foo.org/events is redirected to a non-WordPress site https://bar.org/events. On my .htaccess file, I set the following: Redirect 301 /events ...
0
votes
0answers
27 views

Open wordpress page in directory the way index.html would open

I have a directory /mydir. If I put an index.html in there, it will open when someone browses to example.com/mydir, and their browser shows only the path, not index.html. How can I get the same ...
0
votes
1answer
19 views

Point 404 pages to homepage

I would like to build a website where all page URLs point to the homepage. Wordpress already shows URLs like website.com/randomstring/ as a 404 page. However, instead of the 404 error, I would like ...
1
vote
2answers
49 views

Point all URLs to homepage but maintain URL

I would like my website to point any URL website.com/about/ website.com/about/more/ to the homepage. However, I would also like to maintain the URL in the browser URL bar. How can I achieve this? A ...
1
vote
0answers
14 views

How can I redirect a URL to an anchor link while maintaining the URL?

I am building a one-page website which has multiple sections which I have implemented using a custom theme to display all my pages in one single homepage. I would like the user to be able to navigate ...
2
votes
1answer
10 views

Menu links only using http after enabling https, unable to redirect http links

I have a WordPress website on a Bluehost shared hosting server and since I have multiple websites in my space, I have this particular folder in its own folder under public_html. This means that I have ...
0
votes
0answers
21 views

Unable to redirect on correct page (if user is not logged in)

I am using paid membership pro plugin to manage the users and their subscription at website, I am facing this issue, I have News page (setup as Posts page) and some categories of News (posts ...
0
votes
0answers
86 views

How to allow only vpn access to dashboard on Bitnami WordPress by IP address restricting

I'm trying to restrict access to the Bitnami WordPress(with apache) dashboard to VPN access only. The current environment is below. The WordPress site The site build by AWS Lightsail WordPress ...
1
vote
1answer
40 views

XMLRPC filtering through htaccess not working

My websites are hosted on a shared instance. They face regular xmlrpc DDoS. I've tried to put in place several mitigation practices to block those attacks : Installed a dedicated extension that ...
1
vote
1answer
51 views

How to remove duplicate and unnecessary part in a url using htaccess and regex?

I want to permanently redirect some URLs that have been removed and robots insist on following it. I have the default WordPress configuration for .htaccess. www.example.com/customers/em/customers/any-...
1
vote
1answer
46 views

htaccess - RewriteRule without redirect not working

I had to create 3 page templates to display some content retrieved from different webservices outside of Wordpress. The templates are: page-collections.php page-collection.php page-productDetail.php ...
1
vote
1answer
22 views

I need to redirect an entire subdirectory in WordPress to the homepage - is this correct?

To redirect ALL the pages within a subdirectory I can use this .htaccess rule: RewriteRule ^subfolder http://www.example.com/ [R=301,L] My question is: can I simply use this exactly as prescribed? ...
1
vote
0answers
81 views

sitemap contains weird links and does not contain my pages [closed]

I was about to submit my wordpress auto-generated sitemap to Google Search Console but I realized my sitemap contains weird links and it doesnt contain any of my actual pages. I checked example.com/...
1
vote
1answer
59 views

Only expose routes with prefix /wp-json on WordPress using Apache

Pretty straightforward: I want to only expose routes with the /wp-json prefix so that I can use headless WordPress without exposing the rest of my WordPress site to the internet. I'm running this on ...
2
votes
2answers
59 views

Keep getting 401 error from WordPress on AWS Lightsail

I'm trying to post to a WordPress server on an AWS Lightsail instance using node-wpapi. However, the server returns a 401 error. I already have a .htaccess file with RewriteRule .* - [E=REMOTE_USER:%{...
0
votes
0answers
19 views

Block IPs in htaccess on specific WP page?

I have a special WP page and I want to block some IPs (ahrefs bot and other backlink checkers) in htaccess. Lets say the page is mysite.com/special/ I only want to deny access to that special page to ...
1
vote
1answer
56 views

Changed permalink structure. Need help with redirecting old posts

I just changed the urls structure of my site and want old urls to be forward to the new without the use of redirection plugin. Old structure: /%category%/%year%/%day%/%postname%/ New: /%postname%/ ...
0
votes
0answers
32 views

Use a 301 to Redirect any 404 from at the blog post level to the blog archive

In the .htaccess file, I am trying to write a 301 to catch any broken blog page links to redirect to the blog archive page? so something like Redirect 301 /blog-archive/category/{any 404} /blog-...
1
vote
0answers
20 views

.htaccess rewriting old RSS feed URL to WordPress feed URL

I migrated my old site to WordPress, and I tought rewriting old RSS URL will be easy. Nope. My old RSS feed was served on /rss.php URL. So I added to .htaccess: RewriteBase / RewriteRule ^rss\.php$ /...
2
votes
3answers
420 views

Using "wordpress_logged_in" to restrict direct access to uploads folder in 2021

I am looking at ways to restrict direct access to the Wordpress Uploads folder. I've read a handful of Stackoverflow and blog posts about using "wordpress_logged_in" in .htaccess to check if ...
0
votes
0answers
17 views

How can I make a plugin that will add entry to htaccess?

I have a personal wordpress plugin that includes various security fixes with php snippets. I want to add a feature in the plugin which is in short- I will active the plugin and the plugin will add ...
1
vote
2answers
388 views

Corrupt .htaccess file

My site was running well last summer. But today when I tried to make updates in the wp-admin section, I got lots of 403 errors on all PHP files: load-styles, load-scripts, edit.php, media-new.php, etc....
1
vote
1answer
113 views

Adding rewrite rules directly to .htaccess file

I wanna add a simple rewrite rule RewriteRule ^apply\/? https://docs.google.com/forms/d/e/1FAIpQLSf5IrOhg0E_NAGZnOvMuaXhU80sio8bukaWVBkb87eEOa9kTw/viewform [L] my .htaccess file is like # BEGIN ...
0
votes
0answers
33 views

How to set up MS Exchange Autodiscover alongside Wordpress

My client's IT person has thrown up a flag regarding their need to use MS Exchange Autodiscover service, and that potential issues may possibly arise (ie as a result of sharing the domain with the ...
1
vote
1answer
86 views

Only plain permalinks working

I've a problem with a site (part of a multisite structure). All of a sudden all the static pages are showing the list with the last posts, except for the homepage. The single posts are working fine. ...
0
votes
0answers
21 views

Show the redirect URL in the adress bar

I'd like to know if it's possible to show the redirect URL in the address bar above? Currently, my website is live on https://www.example.nl/ and when you enter www.example.ch it redirects you to ...
0
votes
0answers
33 views

How do you remove the “The Link You Followed Has Expired” error for a subfolder website?

I am building a wordpress website in a subfolder of a drupal website. I want to add a new theme by uploading a theme file but I keep getting the “The Link You Followed Has Expired” error. From my ...
1
vote
1answer
28 views

Redirect homepage with htaccess, except if I enter the link adding "/home"

I'm trying to do something specific here, that may be a little complicated and I can't figure out how to do it. This is what I have with htaccess: RewriteOptions inherit RewriteCond %{HTTP_HOST} ^...
0
votes
0answers
43 views

Rewriting subfolders to specific parent folder in Wordpress

I have created one page with name /parent/ and assigned new template template-parent.php that has some 3rd party software showing via JavaScript. I need to rewrite all subfolders to this parent so ...
1
vote
1answer
43 views

Redirect subdomain in Multisite installation?

One of my clients has a Wordpress site that is a multisite installation. They are running a new campaign that I have set up as a page under the main site at example.com/summer/. However, they sent ...
0
votes
2answers
27 views

How to rename custom taxonomy URL with extra words

There are 2000 Custom Taxonomies, called tax_city in my website https://www.example.com/tax_city/london and I want to change URL to something like this: https://www.example.com/services/home-care/...
1
vote
0answers
108 views

503 Service Unavailable error was encountered

When I try to upgrade PHP to version 7.4 or 7.3, I get the following error: Service Unavailable The server is temporarily unable to service your request due to maintenance downtime or capacity ...
0
votes
1answer
33 views

Redirect htaccess [closed]

I need to help with redirect my page. For example I have websites https://example.com. I need to move content from https://example.com to https://example.com/blog. That is not problem and I do that ...
1
vote
1answer
30 views

AWS Wordpress Install - pages/posts 404 on restart until updating permalinks

I have launched a WordPress instance on AWS using elastic beanstalk. Every now and then AWS restarts my server and when it does all my pages/posts links switch to returning 404. I can fix this by ...
0
votes
0answers
41 views

Azure WordPress deny access to xmlrpc

I am trying to disable xmlrpc.php by using a plugin and also by using .htaccess. But it doesn't seem to be working, when I hit example.com/xmlrpc.php I still get the following: XML-RPC server accepts ...
0
votes
0answers
26 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
163 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
3answers
40 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 ...

1
2 3 4 5
26