Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

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.

0
votes
0answers
34 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
27 views

.htaccess rule to redirect old URLs to new structure

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
19 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
43 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
20 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
28 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
11 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
49 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
43 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 ...
0
votes
0answers
12 views

Search by Category With Custom Search

Please help me out, Is there any way I can make a custom wp search to work on category? already I have a custom search with /search/ permalink. But it does not work on category it only works on ...
0
votes
2answers
51 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
18 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 ...
0
votes
0answers
14 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
26 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
22 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
27 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 ...
0
votes
0answers
32 views

Need Help with .htaccess to Make Pretty Permalinks Work

I am in a huge problem where my blog is being redirected to 404 error page when I use %postname% permalink but %plain% permalink works fine. Let me tell, I have made a custom theme for my WordPress ...
1
vote
2answers
74 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
1k 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 ...
1
vote
0answers
30 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 ...
0
votes
0answers
12 views

Windows IIS7: Wordpress redirecting to home page after press login submit button

I have setup the WordPress website on windows IIS7 web server with MySQL. Through the IP address my website and admin login is working fine. But after i switched the IP to URL(https://www.carine.ae) ...
1
vote
2answers
38 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
22 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
28 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
58 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
9 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
41 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
27 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
33 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
23 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
29 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
27 views

How do I fix my 404 error

I hope you can help I changed my website url from http://www.dynotorque.co.uk to https://dynotorque.co.uk without getting an SSL cert. After this my website would no longer load and all i would ...
0
votes
0answers
32 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
61 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
15 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
49 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
64 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
81 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
31 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
19 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 ...
2
votes
3answers
101 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
278 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 ...
0
votes
1answer
236 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 ...
1
vote
2answers
331 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
34 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
23 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
81 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
102 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
26 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
41 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/...