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

.htaccess to redirect to a wp page

My custom .htaccess commands are above the WP ones. This is working: <IfModule mod_rewrite.c> RewriteEngine On RewriteRule ^$ wp-content/ahoj.txt [N] </IfModule> It shows the contents of ...
0
votes
0answers
28 views

Wordpress pagination broken for page 2,3 with custom permalink. Redirects to baseurl

I have a forum installed with my Wordpress site. My pagination does not work and redirects pages 2,3, or more to baseurl when they are on homepage. Here are the settings: Forum baseurl: https://...
0
votes
1answer
371 views

Htaccess file reset automatically how to fix this issue

Often my WordPress htaccess file was reset am not able to find the root cause of this issue. But I guess this may happen when installing any plugin or manually take a complete backup of the site. Also,...
1
vote
1answer
50 views

Wordpress: Adding Security

Regarding this answer, is correct to add the file debug.log in this way? RewriteRule (?:debug|readme|license|changelog|-config|-sample)\.(?:php|md|txt|html|log?) - [R=404,NC,L] Kind Regards
1
vote
1answer
592 views

remove query arg from url after set query

i make migration plugin from specific script to wordpress, but i have a problem on redirect old urls to new one old urls is like book.php?view=12a34b56 and i want redirect it to book/12a34b56 i try to ...
4
votes
1answer
223 views

Name-based virtual host configuration in Apache seems to cause a “500 Internal Server Error”

I have the following problem: I made 10 WordPress sites for 1one client and now he needs me to configure the domains in his VPS. Based on some searches I did on the internet, the first thing I needed ...
0
votes
1answer
67 views

Clone WordPress for testing on localhost (with Fiddler)

My local setup for WordPress is at http://127.0.0.3/blog. When calling https://my.domain.name/blog/wp-login.php, I get the page served; including Google CAPTCHA. But the login post to a 302 redirect ...
0
votes
0answers
36 views

ErrorDocument 410 gives me back a 302 header

I've deleted several pages and tags from my site, and bases on my SEO recommendations I've redirected them to 410. I've done that in my .htaccess file this way: RewriteRule ^tag/lorem/?$ - [G] ...
1
vote
1answer
60 views

Redirect http to https does not work on subdir where another instance of WordPress installed

I have installed two instances of WordPress, on https://www.example.com/ and a subdirectory https://www.example.com/blogs/ Now to make all HTTP URLs be redirected to the HTTPS version, I add the ...
0
votes
0answers
22 views

PHP application in sub directory keeps redirecting to main site

I've got a PHP script which I have setup in a subdirectory (public_html/phpscript) but whenever I try to access it via www.example.com/phpscript I get redirected to the main site with a 404 page not ...
1
vote
1answer
72 views

How can I fetch the content of a post of my wordpress domain from an other domain?

I have my wordpress website, let's say wp.com, and an other domain, let's call it js.com. I would like to allow GET queries coming from the javascript client code of js.com to wp.com. Something like: ...
0
votes
1answer
407 views

How can I redirect users on the new 404 page without plugin?

I have a 404 page in my theme but I am not using that page. I have created a new 404 page in WordPress using wpbakery page builder. I need to know how can I redirect users on the new 404 page without ...
0
votes
1answer
219 views

How to fix URL with pageid example /?p= too many redirection error

I have recently updated my WordPress to 5.5 and I encountered "too many redirection error" when I use URL with page id /?p=1234 (previously it was working before the update). It keeps ...
0
votes
0answers
16 views

hide theme files for admin beneath root

The purpose is to give full admin rights, but not to the proprietary theme files. Our website is on /root/public_html/ We want to move only the themefolder /root/public_html/wp-content/themes/ beneath ...
2
votes
1answer
585 views

Remove special characters in a URL

I need a help to prevent special characters in URL & it should redirect to 404 error page, if anyone specifically entered characters. I tried a couple of ways through .htaccess but none of them ...
1
vote
1answer
75 views

Fixing custom 404 pages broken by Wordpress in a subdirectory

I used Installatron to install Wordpress in a subdirectory of an existing PHP website, to add a blog to that website. My main website is administered via cPanel. Here's my website directory structure: ...
1
vote
0answers
467 views

Htaccess file isn't redirecting http sub-pages to https––they display 404 error instead, tried many solutions and none work

I installed SSL on my Google Compute Engine hosted WordPress Multisite installation, and have been having a hard time getting it working fully. Right now, the main domains for each site redirect ...
1
vote
1answer
20 views

How to redirect a page to another?

On my website, I have following url structure: example.com/test/ example.com/test/a-page example.com/test/another-page How can I redirect all of the URLS that contains /test/ right after the domain ...
1
vote
1answer
17 views

.htaccess edits

WordPress newbie here, apologies if things don't make sense. I bought a premium theme and uploaded/installed it to WordPress. Surely enough, after doing so, I found out that I was supposed to add the ...
2
votes
2answers
159 views

Call to undefined function insert_with_markers

I'm experimenting with creating a function to write code into htaccess (I understand the security issues associated). I'm currently using the function insert_with_markers() as a starting point however ...
0
votes
0answers
17 views

Redirect default pagination page to template page's pagination

How do I redirect the default pagination pages such as http://mywebsite.com/page/2 to a template page so it looks like http://mywebsite.com/articles/page/2 articles is a custom template page and not a ...
-1
votes
1answer
272 views

Where is the htaccess in wordpress.com hosting?

I am looking to upload a htaccess file or amend the existing htaccess, assuming there is one being used by WordPress. All i want to achieve is denying access to my WordPress site and allow specific ...
0
votes
1answer
415 views

Password protect directory but not files

I'm running a WP+WOO site for a client and thought that a simple way to secure the admin login area would be to password protect it. The problem is that sometimes (especially on WooCommerce pages) ...
0
votes
2answers
245 views

Force a 403 response to xml file in Wordpress

I'm looking to force a 403 access denied response for an xml file in a directory outside of the default Wordpress install. The url I'm trying to force the 403 response on looks like this mydomain.com/...
0
votes
2answers
513 views

How to forward all requests starting with a specific folder name to the same folder

In my Wordpress website main directory, I created a folder servers, which contains two files .htaccess & index.php. In the .htaccess file, I add those lines to redirect all requests to that folder ...
0
votes
1answer
184 views

301 redirect any RSS feed on level up url

On my site I've got RSS feeds - something like this: www.example.com/en/shipper/feed/ www.example.com/en/carrier/feed/ I want to 301 redirect all those URLs to the level up, respectively: www....
0
votes
1answer
38 views

Woocommerce posts and products links works only once and then get 404 error

Permalink to products and post of my website getting 404 error. after saving the permalink type in Setting -> Permalink page they will work correctly. But if I refresh the links they get 404 error ...
0
votes
1answer
15 views

How do I write a subdomain redirect?

I'm trying to write a redirect so that anyone who tries visiting "www.example.au" is directed to "www.example.com", but I'm not sure how to do that in my .htaccess file. So far, I'...
1
vote
1answer
85 views

Wordpress rewrite rules don't need ^?

For example this code class My_Sitemap { public static function install() { add_filter('rewrite_rules_array', array(__CLASS__, 'rewriteRules'), 1, 1); global $wp_rewrite; ...
0
votes
0answers
16 views

Pages from admin dasboard missing after site migration

i migrated a site which was hosted on wp-engine to my local machine, after the migration in the admin dashboard i saw most of the pages are missing. on the wp-engine server, there are 59 pages, but ...
0
votes
1answer
61 views

Understanding Redirects

I have a WordPress website that is working well. The website is shared hosted on a popular hosting site. It was migrated/transferred from a different hosting site to the current one (this point is ...
0
votes
0answers
48 views

multisite 404 subfolder same name slug as site

To keep this short, as a disclaimer, I'm not that versed with WordPress, servers, etc, so I might talk gibberish: The Issue 🠺 I have a multisite root, let's call it msite.com 🠺 This site spawns ...
1
vote
0answers
14 views

"View post" leads to odd URL

On one of my sites, pressing "View post" from the back-end creates an odd URL, always taking the user to the homepage. The correct URL shows when you mouse-over the link - for example - www.trunk....
2
votes
0answers
76 views

Create subdomain masking for each user in WordPress

I am trying to add subdomain URL for each user. For eg: if my site has a user name as John then the URL which he will be sharing with his users is http://john.example.com and this should open the ...
0
votes
1answer
12 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
751 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
10 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
258 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
20 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
401 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
19 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
58 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
36 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
317 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
144 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
44 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
119 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
164 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
1k 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
67 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 2
3
4 5
26