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
1
vote
2answers
57 views

Redirecting old permalink structure to new in htaccess

I recently changed the permalink structure on my 2-month-old blog to a user friendly one which means a whole bunch of 404s. I wish to redirect the following: https://example.com/poastname.html to ...
0
votes
0answers
66 views

URL Rewrite 404

I've got the following ReWrite rule: add_rewrite_rule("details\/([a-zA-Z0-9_]+)\/.*", "detail/?id=$matches[1]", "top"); Which seems to be adding in the following to my .htaccess, which now looks ...
1
vote
1answer
41 views

.htaccess rule to redirect old URLs to new structure [closed]

The old URLs were in the form: https://www.example.com/collection/item/item-name-123 The new URLs are in the form: https://www.example.com/collection/item/123 I'm attempting to redirect any hits ...
0
votes
2answers
2k views

main-domain of wordpress keep redirecting to subdomain

I was in process of deploying my wordpress website mysite.com/NewSite to mysite.com during the deployment I messed up something and my main site has started redirecting from mysite.com to mysite.com/...
0
votes
1answer
197 views

How to disable all logins except Network login in WordPress Multi site?

I have N number of sites in WordPress multi-site. I want to restrict individual site login i.e., http://www.example.com/site1/wp-admin http://www.example.com/site2/wp-admin Only Network admin can ...
0
votes
1answer
141 views

After moving Wordpress to its own directory, login doesn't work

My site keeps getting hacked, so I decided to move WordPress to its own directory so that I can generate and use static pages in the main directory with Simply Static. I am trying to move WordPress ...
1
vote
1answer
46 views

Unable to access folders in same level as wordpress installation

I've got the following structure www/ .htaccess /website1 /website2 /uploads/foo.pdf /websiteWP .htaccess .htacces in root (www/.htaccess) <IfModule mod_rewrite.c> RewriteEngine ...
1
vote
1answer
133 views

How disable canonical redirect wp-signup

I use wordpress 4.9.8. I want to close user access to site.com/wp-signup.php I added code in .htaccess <Files wp-signup.php> Order Allow,Deny Deny from all </Files> When I go to site.com/...
2
votes
1answer
425 views

How to install WordPress Multisite with different domains under the same subdirectory?

Currently I have a WordPress blog with one domain as following: http://example.com/blog All WordPress files are under blog directory. Now I want to create another site using WordPress Multisites ...
2
votes
2answers
70 views

.htaccess redirects no longer work

In May of 2016, I implemented several redirects on a client site using .htaccess. The client verified that all of the .htaccess redirects were working to their satisfaction before we closed out the ...
1
vote
2answers
788 views

How do I test to ensure that my wp-config file is protected?

Since order allow,deny is deprecated in 2.4 I wanted to rewrite the rules in my .htaccess file to use the new rules. Previously I was using: <files wp-config.php> order allow,deny deny ...
1
vote
1answer
443 views

WordPress keeps redirecting subpages without http to https homepage after switch

I just updated my WordPress site to a full SSL certificate. Everything is working as expected. Only 1 issue I can't solve. After the update I noticed the homepage is being redirected as expected but ...
1
vote
0answers
19 views

Wordpress sites in subfolders

I have a slightly different question to the usual 'how to put WP into a subfolder' I have two completely separate variants of the same WP site online - a live and a test one. The sites are in ...
1
vote
1answer
68 views

How to write .htaccess so that https is on for subpages only but not the home page

The root of my domain successfully redirects to a subdirectory, meaning example.com redirects to example.com/abc. example.com has no WordPress install. example.com/abc has its own WordPress install. ...
0
votes
2answers
404 views

Redirect only PDFs in different folders?

I need some help with google indexing old PDF pages. Here is the situation: I have a new URL of new.example.com. The website was rebuilt and the company name has changed. The URL used to be old....
0
votes
2answers
32 views

I used single quote to design HTML of my WordPress blog. Now site redirects to index.php everytime than page.php or single.php

I am actually building a custom theme for my blog and I use single quotes for HTML everywhere like: <div class='div'></div> Does this cause me redirection to index.php?? My site ...
1
vote
3answers
1k views

Force www to non-www on a subdomain in WordPress?

Forcing www to non-www is simple at the primary domain level. What about at the subdomain level? If I am correct the "issue" is that it is at two levels of depth so you can't force a subdomain to be ...
7
votes
3answers
2k views

Does this .htaccess security setting really work?

What does this .htaccess do? Am I correct in thinking that all it does is prevent automatic brute force attacks? So, to access the wp-login.php you have to manually type in the URL of the domain so ...
2
votes
0answers
111 views

Alias 'wp-content' directory to something shorter (framework?)

I recall seeing this as a feature of a Wordpress Development Framework, so I know it's possible (can't remember the framework). I am interested in how to condense the Wordpress-generated urls to ...
1
vote
2answers
634 views

How to redirect subcategories to a page?

I want to redirect all subcategories who belong to the category named symptoms to a same page. I did this: RewriteRule ^category/symptoms/(.*)$ https://my-site/com/list/$1 [L,R=301] Wordpress ...
0
votes
1answer
169 views

Non-wordpress subdomain on Multisite Installation

I have Wordpress multisite and I want to exclude one subdomain from multisite. I am a little bit confused. Wordpress multisite directory: /var/www/XYZ (domain example.com, subdomain: 1subdomain....
1
vote
0answers
192 views

How do I configure wordpress structure for development using git and composer

I've been developing in other languages and web frameworks and I'm now starting with a Wordpress project. I'm used to using git and a package manager, but Wordpress development poses some unique ...
0
votes
1answer
574 views

Unable leverage Browser Caching on AWS Bitnami stack (Apache) through W3TC and Cloudfront CDN

I followed many tutorial about leveraging browser caching nevertheless I couldn't configure it succesfully, in fact GTmetric (PageSpeed and YSlow) notified me many static file that don't have a cache ...
1
vote
0answers
12 views

Admin Panel Slowdown After SSL Verification

a few days ago I did SSL verification for my website. I've imported the following rules on IIS after receiving the http 500 error frequently today. <rule name="Imported Rule 1"> ...
1
vote
1answer
193 views

Https Redirect infinite loop in Mobile browsers

I have recently installed SSL on my website and made some changes in htaccess to rewrite http to https routes. It is working perfectly fine in desktop browsers but not in Mobile browsers. Not sure ...
1
vote
1answer
96 views

Redirect All Search Links Containing - to + on Wordpress

I deleted all my wordpress tags via phpmyadmin, and most of my post content contains tag links, now I redirected all the tag links to search using .htaccess, I.E example.com/tag/stack-exchange/ ...
0
votes
0answers
332 views

Deny php execution in /wp-includes - using .htaccess in /wp-includes VS root folder

Trying to secure my WP site. In an attempt to deny php execution from the wp-includes folder wondering if these two methods are effectively doing the same thing? 1) add new .htaccess file to root of ...
1
vote
1answer
46 views

Only Allow Front End Access

I am new to wordpress and am looking at a way to only allow users access to the front-end of my site. It is a one page vlog site, but I am forcing users to register to view. Is this handled in wp-...
1
vote
0answers
40 views

Wordpress category with 404 error

Okay, so I'm facing a weird problem as I'm receiving 404 errors on blog category pages and I already did the most popular tricks to solve it, such as: re-install Wordpress update permalinks update ....
0
votes
0answers
62 views

Events Calendar Multisite 404 for events

I haven't seen any solutions that work for me or apply to my use case. but, I have a url like https://www.example.com/site1/event/some-event-2017-01-17/2018-08-30/ this will throw a 404 page not ...
1
vote
0answers
806 views

Rewriting "pretty" blog category URL with htaccess / add_rewrite_rule() causes 404 page

I'm migrating a site between hosts and am having issues with what should be(!) a fairly simple rewrite of a "pretty" URL to display posts filtered by category. domain.xyz/category/cat_name/ => ...
-1
votes
1answer
28 views

Restricting direct downloads of wp content files, but allow them on the website.

I have a wordpress and have looked at many solutions. The most common one is the .htaccess and when I do that, it doesn't work? I want to embed youtube videos from the "offical" youtube on my ...
1
vote
2answers
319 views

Plain permalinks not working!

For my wordpress website plain permalinks are not working. The post url is changing but when we click on the post its not redirecting to the post page. It will be in the home page itself. For example:...
1
vote
1answer
549 views

Redirect htaccess does not work correctly with my new wordpress site

I have an old website that works fine (www.example.com). I have created a new website (www.example.com/wordpress) and I thought I could use .htaccess to redirect as I've done it for other html ...
2
votes
1answer
3k views

Rewrite WordPress Custom URL

I have a custom WordPress url which is generated by ID. I have to rewrite this url https://example.com/account/customer-bookings/?view-booking=4 to https://example.com/account/customer-bookings/view-...
0
votes
2answers
33 views

change URIs of migrated site

Hi Ive uploaded a WP site onto a new server updated the DB and can get into the backend and even see the homepge. However, all the links are messed up. I wasnt able to change the URL in the settings ...
0
votes
1answer
43 views

Fresh install redirects to www, breaking page loads

I set up a new Wordpress site, wanderandponder.com, on DigitalOcean yesterday. It was on a droplet that also ran several other Wordpress sites, without conflict. However, when accessing the domain, it ...
3
votes
5answers
1k views

htaccess rewrite for author query string when WP is in subfolder

I have successfully forbidden access to any kind of author pages whether trough /author/username/ or the ?author={#id} query string. I did this with this added to the beginning of my htaccess file: &...
3
votes
1answer
727 views

Changing Permalinks to a Custom Permalink causes a 404 Error [no matter what I do]

I've changed my permalinks to a custom one. When I saw my contact page was sitting on [domain]/index.php/contact instead of [domain]/contact this isn't isolated to /contact however. I went and deleted ...
1
vote
1answer
2k views

Possible htaccess configuration issue for HTTPS websites by WP Fastest Cache plugin? [closed]

I am using WP Fastest Cache plugin for my HTTPS website. The plugin once activated adds several lines of code to the htaccess file. I doubt the presence of RewriteCond %{HTTPS} !=on in the below ...
2
votes
2answers
6k views

Redirect to https not working with .htaccess [closed]

I have the following setup in my .htaccess file, but I am still able to go to my site via http: # BEGIN WordPress <IfModule mod_rewrite.c> RewriteEngine On RewriteBase / RewriteRule ^index\.php$...
0
votes
1answer
76 views

Redirect HTTP request to HTTPS request

I am running a website that's not on Wordpress, it is built by another developer using custom framework and it is too terrible. That's what make me crazy now. Currently, I need to rewrite the request ...
1
vote
0answers
80 views

How to block access to files without modifying .htaccess or ngnix config? [closed]

I'm trying to prevent access to readme.txt files on a WP site. Normally, this would be easy by just modifying the .htaccess file or the ngnix configuration. However, the host runs ngnix, which ...
2
votes
1answer
425 views

Wordpress multisite htaccess redirection to new domain

RewriteCond %{HTTP_HOST} ^site.olddomain.com$ [OR] RewriteCond %{HTTP_HOST} ^www\.site.olddomain\.com$ RewriteRule ^(.*)$ https://site.newdomain.com/$1 [R=301,L] All posts URLs are redirecting ...
0
votes
2answers
2k views

Migrated site - Images have 404 error

I migrated my site from localhost (LAMP) to Namecheap and it is broken in that the images it is supposed to load from /wp-content return a 404 error. I can login to wp-admin and I can see the pages ...
-1
votes
1answer
93 views

rewrite rule on plugin activation

I Have Developed a plugin. And I created a rewrite rule manually in .htaccess file. RewriteEngine On RewriteCond %{SCRIPT_FILENAME} !-d RewriteCond %{SCRIPT_FILENAME} !-f RewriteRule ^(\w+)$ ./...
2
votes
1answer
422 views

RedirectMatch and Redirect interfering with each other

I have the following lines in my .htaccess (there are other lines but these two are next to each other) RedirectMatch 301 ^/datingstories https://example.com/blog/category/relationships/...
1
vote
1answer
9k views

How To Fix A Redirect Chain

I hope someone might be able to help with this. My site crawl is showing that I have a redirect chain on my home page. Basically it shows I am going from : http: > https: > https://www. I need ...
0
votes
0answers
261 views

Multisite htaccess with domain rewrites

The situation is a multisite with SSL and some subsites have their own domain names. Main site is www.example.com Subsite is www.example.com/subsite1 Subsite1 has their own name of www.subsite.com ...
1
vote
1answer
34 views

.htacess rewrite condition: page to seconddomain/page

I am using a single WordPress installation for two separate websites with different domains. To redirect the second domain to its own index page I use. RewriteEngine On RewriteBase / RewriteCond %{...

1
5 6
7
8 9
26