Questions tagged [htaccess]
Directory-level configuration file found mostly on Apache web servers
1,612
questions
3
votes
1
answer
228
views
Duplicate Homepage in search results with different hash-bang URLs
I just realized that my homepage is present in google with three different URLs.
https://www.example.com
https://www.example.com/#!/page/2/
https://www.example.com/#!sweat-shirts
So I guess I need to ...
2
votes
1
answer
41
views
Create 301 redirects for subdomains from expired domain for SEO
I just bought an expired domains and there are lots of backlinks to different subdomains.
I am planning to make a new blog on the domain and I want to get all the link juice.
So I guess I need to ...
1
vote
0
answers
18
views
How to 301 redirect site alias domain to a subdomain on the same hosting?
We have the following problem in Cpanel / htaccess file when trying to 301 redirect example.hu (alias) pages to example.com (subdomain) pages:
Cpanel example.hu to example.com redirection is working, ...
0
votes
1
answer
41
views
Problem displaying 'includes'
I am having a hard time figuring this out. I hadn't changed anything on the site before this, however my webhost (BlueHost) sometimes messes with my files.
Anyway, I am not able to bring up anything ...
2
votes
1
answer
16
views
custom 404 page not work Apache/2.4.51 if missing is in a virtual subdirectory (Debian)
this is my first question here, I hope to find a solution.
I have a problem with page 404 when the missing page is in a sub "virtual" directory, is used to pass a value to php, in ...
2
votes
1
answer
96
views
Rewrite URL with one unnecessary parameter
I have the following URL examples. Example one is a URL without "amps" parameter:
https://multilang:8890/uk/seconddoc.html/ there I have a 404 error. And an other one with that amps ...
1
vote
1
answer
39
views
Redirect AMP Parameter To Its Permalink caught in Redirect loop
I have the same issue as mentioned on Redirect AMP Parameter To Its Permalink, the solution given by Mrwhite solved my problem and everything went fine
# Redirect old "amp" URLs back to ...
0
votes
0
answers
55
views
Unexplainable 301 redirect persists after redirect is deleted
I am using wordpress on a domain on my server and I am trying to configure redirects from a parked domain to my main domain.
My main domain uses wordpress. My parked domain uses nothing (no wordpress ...
0
votes
0
answers
50
views
.htaccess security headers for IONOS
I need to implement security headers for a website hosted by IONOS. I've used the following code, which works on sites hosted elsewhere, but not here.
<IfModule mod_headers.c>
Header set ...
0
votes
0
answers
26
views
I want to redirect 301 to an added query string
I do want to 301 redirect https://example.com/no/ and all the URLs from that catalogue with an added query string ?lang=no. For example will then url https://example.com/no/about/ be https://example....
0
votes
1
answer
49
views
503 Service Temporarily Unavailable nginx [closed]
how to fix this issues: when i use www.dbahack.com it show me this message "503 Service Temporarily Unavailable nginx"
here is my DNS from cloudflare:
[![enter image description here][2]][2]...
0
votes
1
answer
50
views
linking 404.htm to .htaccess
I have an old 2004 Dreamweaver website built on HTML. Tired of the analytics telling me I have a lot of 404s, I created a 404.htm page. How do I link the code in .htaccess to it so it will show up, ...
2
votes
1
answer
35
views
Mapping category label url into new custom category permalink?
I migrated my old blog into WordPress, my old cms has a category URL structure like this one
https://www.example.com/search/label/health?m=0?&max-results=8
https://www.example.com/search/label/...
2
votes
1
answer
83
views
Redirect AMP Parameter To Its Permalink
I have a similar situation as described in
Handle "amp" in URLs from a now removed WordPress plugin
the difference is I don't use custom post permalink /%postname%.html but just /%postname%...
2
votes
1
answer
62
views
Handle "amp" in URLs from a now removed WordPress plugin
i used an amp plugin earlier but then I disabled it. Now variations of leftover amp path leave me with a thousand of "not found" or extra additional URLs with amp parameters.
https://www....
0
votes
0
answers
26
views
Show Different content to different users of same post [closed]
Suppose https://example.com/how-to-learn-seo is a post which is published and i want it to show this post content only to bots (google, bing, etc.) not to users. If a user visit then they will see a ...
1
vote
1
answer
75
views
Test website can't be reached despite setting up DNS in local hosts file and adding a virtual host to Apache config
I am trying to set up a domain on my development machine so that I cant test slightly more complex htaccess rules. I am trying to set up example.city domain. Following what I find by googling, I have ...
4
votes
1
answer
42
views
Why rewrite to index.php is not working on a wordpress site?
So my rewriterule is like
RewriteRule ^test$ index.php [L]
I tested it on https://htaccess.madewithlove.com?share=b0a9904b-1ec4-49cd-917c-36426ff6150a it works fine.
I also tested it on live Joomla ...
2
votes
0
answers
34
views
Can I have a generic rule to map subdomains to directories?
I have these rulesets which are working.
RewriteCond %{HTTPS} =on
RewriteCond %{HTTP_HOST} ^www\.example\.city$ [NC]
RewriteRule ^(.*)$ https://example.city/$1 [R=301,L]
RewriteCond %{HTTPS} !=on
...
1
vote
1
answer
50
views
How can I have either php or html file running - whichever exists
I have these two rules and they appear to be working. How can I combine them into one rule
#Force hmtl extn
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME}\.html -f
RewriteRule ^(....
1
vote
0
answers
29
views
.htaccess - Force SSL and dont show .html in URL
I have a website where i want to Force https to all visitors, and I also don't want the URL to show .html at the end.
In Google Search Console and Bing Webmaster tool i get an "Redirect errror&...
1
vote
1
answer
237
views
htaccess for redirects and gone 410
I am facing a problem. THE Problem is that in google search there some spam links that are of type HTTP and I would like to return 410 for those urls that actually do not exist. but for people who ...
2
votes
1
answer
33
views
How do I get .app TLD to work with my .htaccess
I have a number of domains hosted on one server. I tried them as sub-domains but that was a failure. So I obtained new certificates and I have them configured as Add-On_Domains.
They are all using ...
2
votes
0
answers
20
views
I used a permanent 301 redirect and now want to use old domain again, is this bad SEO wise?
I have a blog that I wanted to professionalize it a bit more and moved from a personalized domain name (DomainA/subfolder) to a more professional domain name (DomainB).
The blog is from 2015 and I ...
2
votes
1
answer
58
views
Wordpress - Ignore a server directory containing index.html if being viewed in preview mode
I have wordpress installed on a root directory. Wordpress was often so slow, I created a node script which will look at all pages on the website, and a create a static directory for each one with an ...
2
votes
0
answers
25
views
.htaccess not redirecting me to correct place
I have a website which opens to /resources/Installer/index.php
but the path I need it to open to is /Installer/index.php.
I have asked my webhost to help but they have said they cannot help.
I have ...
6
votes
1
answer
1k
views
Why is a link to www.example.software not working?
I have looked at some posts here, but they dont answer my problem. I have subdomains and addon-domains and not all of them have a certificate yet. So I cannot use a generic solution.
my .htaccess is
...
1
vote
2
answers
50
views
ahrefs site auditing reports a redirect chain that I cant't see. What's causing this?
ahrefs site auditing, reports a redirect chain that I cant't see. Surely, only the first ruleset should be activated. What's causing this ?
domain
http://www.example.software/
Redirect chain URLs
...
3
votes
2
answers
33
views
How does the server remember logged in users on a password protected website via .htaccess?
So basically my question is just a technical one.
We password protect our development server so that no duplicated content appears to google if we mirror an existing website.
How does the server ...
3
votes
1
answer
38
views
How are slashes added between htaccess mod_rewrite variables
I was looking at two different variants of redirects:
RewriteRule ^(.*)$ https://%{HTTP_HOST}/$1 [L,R=301]
RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
And noticed that in the first ...
4
votes
1
answer
75
views
htaccess - URL Rewrite to rewrite specific URLs but allow one subdir URL
We are using a CMS (Magento) where we are looking to have all of the current customer dashboard links redirect to the homepage, however when doing this with simple 301 rewrites, it unfortunately ...
2
votes
1
answer
109
views
How do I prevent access to an add-on domain as a subdirectory of the main domain?
I have my main domain as example.software. I used to have example.kiwi configured as a subdomain, but the hosting company could not get the certificate to work.
They asked me to fork out more money ...
2
votes
2
answers
68
views
Apache maintenance page htaccess without being overriden by subfolder
I want to perform a maintenance on my website, so wrote an htaccess (I do not own the server) to redirect users to a specific page.
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteCond %{...
1
vote
0
answers
22
views
Browser appends a '?' to links on page, but the '?' does not appear in the source [closed]
I'm a little puzzled with the following problem:
When I hover over a link a WordPress site I'm looking after, I can see that the URL is https://xxxxxxx.com/apply-now/?
All the links on the page have ...
0
votes
0
answers
22
views
Where a domain is mapped onto a subdomain, can the redirected url be hidden from the browser
I now have my main domain working fine. I have 5 other independent domains that I am trying to map onto my main domain as sub-domains. I also have a wild-card certificate to cover the 4 of those ...
2
votes
0
answers
61
views
Workaround to password protect new Google Sites with custom domain
I want to create a document and video library, and there are some conflicting constraints:
we want to keep the maintenance and updating of the library separate from the team that manages the main ...
1
vote
1
answer
94
views
HTTP to HTTPS Apache redirect doesn't work when used with other redirects
I have been asked to help with an OpenCart 1.5.6.1 installation on shared hosting with some redirection requirements.
Some of the redirects were already present and I'm not sure if they are required ...
1
vote
1
answer
37
views
.htaccess problem with people with identical usernames
I've recently set up a password protected area on a client's website, but there's an issue where several of the members of the organisation concerned have identical usernames, although, obviously, ...
2
votes
1
answer
48
views
Why is this htaccess evaluating to 302 redirect instead of internal rewrite?
As an example, I was expecting this
https://example.software/credits
to evaluate to an internal rewrite
https://example.software?mode=credits
Why is it showing up on the browser url-bar as a 302 ...
1
vote
0
answers
58
views
How do I redirect a subdomain blog to a subfolder without .htaccess?
I currently have a blog hosted with Squarespace on a subdomain, let's call it blog.example.com. I have my storefront hosted separately on www.example.com. My blog receives a good amount of traffic, ...
3
votes
1
answer
41
views
Password protected directory [c-panel] - receiving no login prompt when the url is clicked in FB Messenger
The public_html folder is password-protected via the .htaccess file. I'm using an Apache web server and hosting on Godaddy.
It works fine if I use any browser on mobile and desktop/laptop devices.
But ...
3
votes
1
answer
28
views
Google didn't update the search results after changing a URL with a permanent redirect
I have a simple personal webpage which I use to list my publications and link the corresponding PDFs (I work in academia). Until now, this webpage was hosted by my university:
http(s)://...
0
votes
0
answers
27
views
Google Adsense is not accepting my Website with www
I have a local eCommerce site built in Wordpress/Woocommerce. If you visit HTTP://example.com it redirects to HTTP://www.example.com. I even tried to perm redirect www. to HTTP://example.com but did ...
1
vote
1
answer
180
views
Updated htaccess to redirect, now receiving ERR_SSL_PROTOCOL_ERROR when I access my site via Search
I made a couple of edits to my htaccess file today to redirect. htaccess now has this:
Redirect 301 / https://www.newsite.org
If I type my domain into the address bar, it redirects properly. However, ...
3
votes
1
answer
54
views
Is there a way to set up a redirect in htaccess to convert a folder/paths to a params
After trawling through posts I have this
RewriteCond %{HTTP_HOST} ^example.software$
RewriteRule ^downloads$ https://example.software\?mode\=downloads&%{QUERY_STRING} [R=302,L]
This works fine ...
1
vote
0
answers
71
views
Allowing POST requests to bypass Basic Auth if on given pages
Current Implementation:
SetEnvIfNoCase Host ^example\.com$ passreq
AuthType Basic
AuthName "Restricted Area"
AuthUserFile /html/.htpasswd
Order Deny,Allow
Deny from all
Satisfy any
Require ...
2
votes
0
answers
42
views
Issue using htaccess to redirect to main domain's subdir for everything except specific subdomains (and subdirs)
Currently we have an htaccess setup using the below settings;
RewriteCond %{HTTP_HOST} !^(staged|foobar)\.example\.com$ [NC]
RewriteCond %{REQUEST_URI} !/(Press_Kits|logos|admin|console|shop)/ [NC]
...
2
votes
0
answers
31
views
Anything here that can be blocking my site from being indexed by Google / Bing? [closed]
I'm unable to get my site indexed by Google or Bing. Robots and sitemap have been submitted but no love... I think the issue may be in the .htaccess file.
Is there anything in here that may be causing ...
1
vote
0
answers
68
views
301 redirect a subdomain and all its variants (https, www, etc) [closed]
I want to redirect 301 from abc.example.com to example.com/abc.html page.
I would like to include all variants of the subdomain in the redirect, like
abc.example.com
www.abc.example.com
https://www....
3
votes
2
answers
568
views
How to Leverage Browser Caching for Fonts in WordPress
I am using WordPress along with Autoptimize and Cloudflare, and using Locally hosted fonts. I can't leverage browser caching on my site.
I tried using Cloudflare Page rules to Leverage 1 year browser ...