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
20 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 ...
0
votes
0answers
15 views

CORS policy blocking my pictures [closed]

I have a problem enabling CORS on my WordPress.com website, hosted by WordPress.com. There's a function which generates and allows to download a PDF file made of text and pictures on the same web page....
0
votes
1answer
32 views

URL rewrite for mu-plugin assets

I have a semi-bespoke scenario, but one that works best for out environment sharing the code workload and accessibility (and version control). We have a multisite that all abide by the same core ...
0
votes
0answers
23 views

Stop home page redirect to subfolder

I have a confusing issue! my home page redirect to subfolder! other pages are ok. just home page makes me confused. fidanfilm.ir .htacces on root is RewriteEngine On RewriteCond %{HTTPS} off ...
-1
votes
1answer
12 views

Comment reply href is different on production vs local

So I can reply to comments on local but it doesn't work on live. I can reply via the admin panel but when I click reply on a comment on a single page, it doesn't work. I checked the code and it seems ...
0
votes
0answers
21 views

Wordpress Multisite determine the correct domain to be set as current/default domain when setting multisite in Local fresh installation

I am unsuccessfully trying to setup multisite with Wordpress's fresh setup(Wordpress installed in subfolder under htdocs of Localhost), but existing copy of Database already imported(provided by ...
1
vote
1answer
12 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
24 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
29 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
14 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 ...
0
votes
0answers
12 views

How do I Fix a Redirect Chain

I'm wondering how to minimize redirects and eliminate the chain from content that's being served both from https. 4 chains in total. All autooptimize cache related.
0
votes
0answers
32 views

Custom taxonomy shared across two custom post types - url rewrites

I'm using CPT-UI to create my custom post types and taxonomies. I have two post types - aulocations and uklocations these work and show up as: /au/locations/{location-names} /uk/locations/{location-...
1
vote
1answer
27 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 ...
0
votes
0answers
12 views

Move root to subdomain and keep root

I have a pretty huge website in root folder of server and I want to move it to subdomain. The biggest issue is that I want to keep root wordpress for marketing purpose (wordpress will be stripped and ...
0
votes
0answers
16 views

Protect certain URLs from users that are not logged in

I'm trying to protect URLs like this on my website from being opened IF the user is not logged in. https://www.example.com/download/17719/ If a user tries to direct link to this and is not logged in, ...
1
vote
1answer
32 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
28 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
19 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
10 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 ...
1
vote
2answers
46 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
16 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
38 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
410 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
0answers
22 views

How To Change a Search Submit URL

how should i change this url: http://127.0.0.1/infobd/new-info/?keyword=hope To this URL http://127.0.0.1/infobd/new-info/hope using .htaccess or add_rewrite_rule it's a search submit URL on WordPress ...
0
votes
2answers
22 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
22 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
25 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
22 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
69 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
11 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
31 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
28 views

Adding a page to custom post type hierarchy?

My custom post type has the URL Structure "/work/post-name" The default archive is disabled with "'has_archive' => false" and replaced by a WordPress Page called "/work/&...
0
votes
0answers
20 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
43 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
0answers
10 views

Trying to load the site via domain but automatically redirects to IP

I have moved a site which was developed in localhost to a new web host with a new domain. I updated the site_url and home_url in the wp_options table. I put a basic .htaccess file to the webroot. But ...
0
votes
0answers
14 views

http Html pages to https wordpress pages 301 redirection

We are going to migrate our current HTML site to WordPress site and also HTTP to https migration for the same website, The entire URL structure changed now. Which one I have to use from the below ...
0
votes
1answer
11 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
89 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
89 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
19 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
40 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
16 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
24 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
50 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
65 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
34 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....

1
2 3 4 5
24