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
0answers
181 views

What happens if I use .htaccess of network multisite on a single site installation?

If I use the .htaccess code given in network setup (subfolder version) on a single site installation, what problems could occur? I am testing this for a project so It's not pointless. I tested and I ...
1
vote
1answer
42 views

Setting custom search engine indexing for a "dynamic WordPress page" with htaccess

I am searching for hours but didnt found the code for my requirement, Can my requirement be done with htaccess? Requirement - These urls of a page should be indexed by Google: example.com/example-...
2
votes
1answer
1k views

Changing URL from /%postname%/%post_id to /%category%/%postname%/%post_id%

I want to add categories to my URL structure. I'm sure this has been covered and I found many resources online to create the redirect code in .htaccess, but when I enter the code it doesn't work. ...
0
votes
0answers
687 views

check if Url contains special character like #

I have site setup in wordpress as root folder like /wordpress and one angular site setup in sub folder /wordpress/angular. Currently if user visits url like mydomain.com/wordpress/sample-page, it ...
0
votes
0answers
79 views

All files in public_html, Cannot launch WordPress site via wp-admin

my registered URL is casualtyclaimscontainment.com I developed the site on AMPPS using the URL kriswebpg.test I uploaded site to https://dallas124.mysitehosted.com I have tried everything in my ...
1
vote
1answer
175 views

Add htaccess rules with insert_with_markers at beginning of htaccess

From my custom plugin, on activation, i want add some rules into htaccess but at beginning of the file. insert_with_markers add the rule at the end of htaccess, eg.: $lines = array(); $lines[] = '# ...
1
vote
1answer
31 views

Load time cost of using a redirect plugin v direct .htaccess entry

Occasionally, when I inherit a WordPress project developed by someone else, there is a plugin installed to do redirects. On my own projects, I enter all redirects directly into the .htaccess file. ...
1
vote
1answer
296 views

Htaccess redirect after changing Language URL format

After have changed the URL language format from http://my-site.com/name-of-page/?lang=en http://my-site.com/name-of-page/?lang=ru to http://my-site.com/en/name-of-page/ http://my-site.com/ru/name-...
1
vote
2answers
2k views

.htaccess file missing from Wordpress install directory

This is occuring on my local machine, Lubuntu 18.04 with apache2 and Php 7.2.15. Steps tried: Enable hidden files No .htaccess file seen: https://nimb.ws/4YJfDT Switch permalink structure to ...
2
votes
1answer
583 views

Why does the header set X-Robots-Tag apply to all pages?

The directives below are intended to apply the header X-Robots-Tag noindex and nofollow to a single page. The directives below are applied before the WordPress code block however it appears to ...
1
vote
1answer
52 views

Why does a directive only work when it is included inside WordPress directives?

The directive below is intended to block access to the thank you page. It appears below the WordPress directives. It does not work as intended in that the page remains accessible and does not display ...
0
votes
1answer
216 views

How To Use htaccess to Rewrite Link Structure for a Page that is Generated Programatcially

My site uses a plugin Easy Digital Downloads, which creates products that are of url structure, sitename/downloads/{Product} I want to change them to sitename/{product} For example, https://milyin....
1
vote
1answer
2k views

Rewrite rule to load images from production does nothing

I'm trying to adapt the rewrite rule given in Develop Locally, Use Images from Production to do the very same thing on my local dev site (which runs on XAMPP). This is how the development site's ....
1
vote
1answer
846 views

I can't access the admin panel links as I click it shows 403 error

I am working on the following website. when I login into the Dashboard and click on any item on admin panel such as post or pages I get the following error: You don't have permission to access /wp-...
0
votes
0answers
68 views

Cannot publish posts or pages when I change permalink structure

I changed the permalink structure to be just /%postname%/ without the index.php, I've added the required lines to the .htaccess file, Allowed override in the httpd.conf but it still doesn't work. ...
0
votes
0answers
21 views

Update htaccess in several WP sites at once

I make changes to htaccess file quite often and having several sites to manage, I have to update every htaccess file in every site. I was wondering how to automate this task... I was thinking about ...
2
votes
1answer
12k views

403 Forbidden - You don't have permission to access /wp-admin/admin-ajax.php on this server

When I try to make a backup of my wordpress website through plugin I recieve the following error: "403 Forbidden - You don't have permission to access /wp-admin/admin-ajax.php on this server." This ...
1
vote
1answer
25 views

WordPress Sub domain

I installed WordPress on sub domain and I have Permalinks as domain/subdomain.com. In this way this website is working correctly and the main website is accessible via subdomain.domain.com as well ...
0
votes
0answers
159 views

WP Multi Site - configure Sub domain pointing to parent sub directory

I've a purchased a hosting plan from hostinger, but it seems they don't provide wild card subdomains. Now I want to set up a multisite wp on hostinger in a subdomain format, not sub directories. When ...
1
vote
1answer
137 views

Remove /sites/25/ from image URLS

I am running multisite with subdomains. I'd like to manipulate the image path for the "espanol" subdomain only. Here is the current image path (example): https://espanol.xxx.xx.xx.xxx.xip.io/wp-...
0
votes
1answer
344 views

Redirect Wordpress site to a landing (construction) page using htaccess, with access to /wp-admin and /invoice

I have tried everything I know and I can't seem to come up with a solution. I am trying to redirect my website to a landing page (which I have put into a folder with a css file, changing the index....
0
votes
0answers
86 views

I need to make one folder private

I'd like to make one specific folder in WordPress private and give access permission only for the administrator role. What I can do for now is to make the folder private by .htaccess and give access ...
0
votes
0answers
69 views

301 Redirect in Wordpress not working in htaccess

I've tried multiple blocks of code and none of them work, i.e.: RewriteEngine on Options +FollowSymLinks RewriteEngine on RewriteRule (.*) http://www.newdomain.com/$1 [R=301,L] and RewriteCond %{...
0
votes
0answers
128 views

Problem to redirect custom page using htaccess

I could not create dynamic post through URL by .htaccess, Page or Post redirect automatically 404 page. I have tried Redirection Plugin, but i could not successfully redirect. Please try to give ...
0
votes
1answer
473 views

Using htaccess to prevent spam through wp-comments-post.php

I have a lot of spam comments being posted on my WordPress site. It is being posted using the wp-comments-post.php file. I can see from the logs: "POST /wp/wp-comments-post.php HTTP/1.0" 302 3744 "...
0
votes
1answer
613 views

How to create multiple Rewrite-Rule for various site in single htaccess?

I am using a single database for two different sites. One is sitejury.com and the other is cdn1.sitejury.com. I'm trying to serve my files using the subdomain. Previously I used simple https Rewrite ...
0
votes
1answer
333 views

WordPress add_query_arg from ajax and make url friendly

In WordPress I have set a query arg in ajax like this add_action( 'wp_ajax_get_prepare_link', 'prepare_link'); add_action( 'wp_ajax_nopriv_get_prepare_link', 'prepare_link'); function prepare_link()...
0
votes
0answers
1k views

Pages in wp-admin is not found 404

I moved my website from localhost to web server. The website works fine. When I explore any page the urls on the website(front-end) are working fine so permalinks are not a problem. Issue is when I ...
2
votes
1answer
1k views

Redirect from different port to subdomain - htaccess

I created a Digital Ocean instance to install WordPress website 5 days ago. I already have my own domain, and created DNS Subdomain blog.example.com. The server runs both nginx and apache so my Apache ...
0
votes
1answer
301 views

How do I do a redirect to WordPress permalink with post id via htaccess?

Years ago I saw Jeff Starr of Perishable Press set up shortlinks for a book of his where URLs such as example.com/u/123 redirected to example.com?p=123. I thought that was a handy way to set up no-...
0
votes
1answer
76 views

How to rewrite wordpress search to work on specific category

I want my wordpress search to work on specific category within custom search, by default this actually work fine example.com/categoryname/?s=keyword but I want to make it work like this example.com/...
0
votes
0answers
66 views

How to hide subfolder of static pages in Wordpress using htaccess

I need help please because I cannot find a solution for my problem. I need to hide a subfolder in the url of my wordpress site. I created a subfolder where I uploaded some static pages in php ...
0
votes
0answers
82 views

Help with .htaccess setup to hide WordPress Directory

I have a WordPress site that is installed in a directory called cms. I will be using a pure HTML page as my Home page, the inner pages will be using WordPress. Let's call the website mysite.com ...
1
vote
1answer
407 views

htaccess file for multiple CMS's (multisite wordpress + wolfcms) on same domain but different subdirectories

Thanks for reading this! The website I am building is used for an annual symposium that is held since 2003. All those website are still online and should remain online. From the year 2003 till the ...
0
votes
0answers
70 views

htaccess redirect to path

I'm trying to get my site to redirect to a certain folder depending on a condition. This condition cannot be done within WP, so... Anyway.. I've done conditions before, but I keep hitting a wall ...
0
votes
3answers
52 views

Increase .htaccess file upload without prompting error

I have a Centos Web Panel hosting and a new WordPress file. I wanted to migrate all of my local WordPress files to the live server so I installed All-in-one WP Migration. Unfortunately it can only ...
0
votes
1answer
209 views

wp-admin and wp-login.php not Accessible after Cloudflare

I have the following .htaccess rule to limit access to wp-admin and wp-login.php locally via SSH dynamic forwarding: Order Deny,Allow Deny from all Allow from 127.0.0.1 However, after installing ...
0
votes
0answers
2k views

WP Migrate DB Pro plugin cannot transfer Media files to remote server

I'm using Delicious Brain's WP Migrate DB Pro plugin to migrate database tables and to transfer Media files (add-on) from my local virtual machine to my remote server (provided by GoDaddy) This ...
0
votes
0answers
30 views

Loading /wp-content/uploads/site as /site/

I love websites so much that I want to put a website into another website. I have a static site under /wp-content/uploads/site. It has a lot of pages and I can access it without an issue in https://[...
1
vote
1answer
144 views

Append country to 'pretty' url but serve same page

For one particular page on my site I would like to append the country to the URL. The reasons for this are purely aesthetic so the customer knows that the prices on that page are in their own currency ...
1
vote
1answer
108 views

How do I redirect all 404 error url to Subcategory url

I have a b blog of over 200k+ post and I moved all post from a specific category to a subcategory, I have also deleted the post from the my main site, so all the post of that category have been moved ...
1
vote
2answers
809 views

How to redirect from various ?page_id= to home page?

I have a website where I need to 301 redirect all old pages that are incoming from old URLs like /?page_id=261, /?page_id=204, /?page_id=2677 and so on to the main home page. What would be a proper ...
1
vote
1answer
53 views

Redirections and rewrites to subdomain

I am currently working on a new WordPress website, to partially replace a non-WP website that includes a webshop. Now, the plan is to migrate the webshop and all matching pages (shopping card, order ...
0
votes
1answer
537 views

Install second wordpress in root subfolder, Error 404

I am trying to install wordpress in a subfolder of an existing wordpress installation. I created a the subfolder /wp unziped a fresh Wordpress download inside of that directory and added a .htaccess ...
0
votes
1answer
857 views

How to allow download url redirection only if user logged in Wordpress site?

I'm trying to allow url-redirection (from /dl urls) only if user is logged-in to wordpress site. Otherwise don't allow. However it went "page not found" when i click these urls with or without logging ...
1
vote
2answers
118 views

How to change redirection route to a php page for making it only accessible by logged-in members?

Background of my problem: I'd like to mask external download links as internal links and to be only accessible by logged-in wp users at htaccess level or with PHP script but when redirection happens ...
1
vote
2answers
97 views

WordPress - Promoting A Dev Build In A Subdirectory To Production / Root Directory

I recently took over a WordPress site with the following directory structure inside of /public_html: wp_config.php /wp-admin /wp-content /wp-includes ... ... ... /development The root (production) ...
1
vote
1answer
771 views

htaccess, site and staging in subdirectories

I have the following task and as it is a little different from most setups, I couldn't find any hints that solved my problem. WordPress for the live site was installed into a subfolder /wp1, the ....
2
votes
1answer
38 views

Why specific file directory fails to redirect but its parent folder succeeds?

I activated multisite using subdirectories on my old WordPress site, and I created a new site (say my-example.com/new-site/). I found links such as my-example.com/new-site/wp-content/mu-plugins/css/ ...
0
votes
1answer
23 views

Iterating users while user iteration is suppressed

Recently I noticed various login attempts being blocked by security plug-in this is pretty much ordinary when the attempt is about non-existent users or default/common user names like the website name,...

1
3 4
5
6 7
26