Directory-level configuration file found mostly on Apache web servers

learn more… | top users | synonyms (1)

-2
votes
0answers
11 views

Can I create dynamic subdomains with .htaccess?

I want to create dynamic subdomains using only a .htaccess file. For example: http://site.asd/user.php?name=jon > http://jon.site.asd/ http://site.asd/user.php?name=username > http://username....
1
vote
1answer
24 views

Redirect loop from two domain using the same .htaccess

How our FTP was setup, the root level is Website #1. Website #2 has it's own directory folder inside that root. Both websites refer to the same .htaccess. If I do Redirect 301 /example/ http://www....
3
votes
3answers
749 views

Is there an alternative to .htaccess?

Is there an alternative to .htaccess, in case the webhoster disabled the use of .htaccess files? I can set some PHP variables and headers inside the PHP files but how can I perform actions like ...
3
votes
3answers
75 views

301 redirect in .htaccess - old URL includes ?page_id=

I want to 301 redirect several URLs from an old WordPress installation within one subdirectory to a new WP installation within a different directory of the same domain. I.E.: http://www.example.de/...
1
vote
0answers
36 views

.htaccess IP whitelist is being ignored

I have the following in my .htaccess file to only allow access from a block of IP's and everyone else is being redirected: <IfModule mod_rewrite.c> RewriteEngine On Options +FollowSymlinks ...
0
votes
2answers
25 views

Block rank-checker.online

This is really messing with my Analytics. I've previously blocked Semalt with the following code in my .htaccess SetEnvIfNoCase Via evil-spam-proxy spammer=yes SetEnvIfNoCase Referer evil-spam-domain....
2
votes
4answers
185 views

Access Website by domain name only (not IP address)

Let's say I have a website example.com and it points to 12.23.42.31. Now I want that nobody can access my website by the IP address (12.23.42.31). What is the procedure to achieve this? LAMP server ...
0
votes
2answers
74 views

Redirect subdomain http:// to https:// - To many redirects

I'm trying to redirect http://sub.domain.com to https://sub.domain.com. I have turned the web upside down trying every .htaccess and PHP script out there, and all of them give me the ...
1
vote
1answer
53 views

How to redirect 301 within subdomain?

I have 2 campaigns at competition.example.com/option_1 competition.example.com/option_2 option_1 and optino_2 are in separate folders which are in root folder. Each file and root has its own ....
2
votes
1answer
27 views

Redirect ALL requests to host IP

I have a honeypot running on AP so if anyone connects and try's to browse it will redirect to the root page. I am using dnsmasq to do this with the following entry log-facility=/var/log/dnsmasq.log ...
0
votes
1answer
34 views

Request for an existing file causes 404 error

A customer cannot access a file that I put online for him, or the folder that it is in. Requests for both the folder (/bastide) and the file (/bastide/coupon%20d'engagement.pdf) return 404 errors. I ...
2
votes
1answer
153 views

How to redirect HTTPS to HTTP behind proxy (CloudFlare)

I want to redirect HTTPs to HTTP, I tried following code in .htaccess file Options +FollowSymlinks RewriteEngine on RewriteCond %{SERVER_PORT} ^443$ RewriteRule ^(.*)$ http://www.yourdomain.com/$1 [R=...
1
vote
2answers
33 views

301 Per Redirect .htaccess w/ match to a set of words

I am trying to edit .htaccess to do 301 redirect from old domain to new. I was wondering if there's a way to do a 301 redirect that matches a certain keywords. So instead of writing 301 for each line, ...
3
votes
1answer
47 views

combined 301 redirects not working

I made some changes to the files on a website and now Search Console is showing me 404 errors for some URLs. The normal setup, which works fine is like this: the user-friendly URL mywebsite.com/...
2
votes
1answer
41 views

How to regex a url to redirect user

Using the regex and the .htaccess file, I want to redirect users to a certain URL. I want to redirect: http://www.example.com/* but not http://www.example.com/CDadmin/* I have tried the ...
1
vote
1answer
27 views

RewriteRule RewriteCond

These codes dont work together... How can I integrate both codes? # Block#1 RewriteCond %{REQUEST_FILENAME} !-f RewriteRule ^search/(.+?)/(\d+)/?$ /search.php?q=$1&p=$2 [L,QSA,NC] RewriteCond %{...
0
votes
0answers
12 views

301 redirect a subdomain to the root domain with www [duplicate]

I want to re-direct all requests to http://subdomain.example.com to http://www.example.com What should the code be?
3
votes
1answer
81 views

HTTP request to an API has been blocked from an HTTPS website

I am facing problem to call web service which is hosted over HTTP and I am calling web service from HTTPS domain. web service's .htaccess RewriteEngine On RewriteCond %{REQUEST_FILENAME} !-f ...
1
vote
2answers
119 views

Create htaccess infinite redirection to random URLs to prevent Facebook crawling

I want make an infinite series of 302 redirects. For example: Visitor accesses example.com Which 302 redirects to example.com/abc Which 302 redirects toexample.com/xzy Which 302 redirects to ...
1
vote
1answer
35 views

htaccess 301 redirect for second level sub directory

I have a directory website with the following URL structure. http://mywebsite.com/information/business-name/ http://mywebsite.com/information/business-name/product-names/ http://mywebsite.com/...
0
votes
0answers
24 views

Fastest .htaccess redirect from example.com to www.example.com?

Now using the standard cPanel-created Apache .htaccess redirect, but it's taking a full 2 seconds to go from ´example.com´ to ´www.example.com´. Is there a faster method? Or should I let go of the ...
2
votes
2answers
51 views

non-www along with https

I need to set the following rules: redirect www to non-www (close www) redirect http to https (close http) Suppose I have example.com , How to set the above rules together in htaccess?
4
votes
2answers
94 views

ErrorDocument in dynamic SubFolder

I host different Websites in 1 web space. But I don't want to give the ErrorDocument an absolute SubFolder name. Is it possible to make website a variable? ErrorDocument 404 /website/error?error=404 ...
3
votes
0answers
41 views

What is the cause of page speed performing extremely poorly on Chrome on Windows and Safari on Linux?

I am more interested in the cause of poor page loading speed on Chrome/Windows, since this combo covers the vast majority of our users. The average page speed in the last month is 55 seconds for ...
2
votes
0answers
14 views

htaccess redirect a subsub directory to new domain same structure [duplicate]

Any idea how to redirect from old domain to new one using htaccess. domain.com/A/B/some-file-bb-cc to new-domain.com/A/B/some-file-bb-cc
4
votes
1answer
40 views

.htaccess rule fails when including $ at end

The Basic Situation We have a server. It has some static files, some simple, "flat" .php and .html pages, but it also has a WordPress install at the document root, meaning that visiting / takes the ...
0
votes
0answers
40 views

How to add http:// prefix to subdomain redirect in htaccess

I am rewriting a subdomain URL with a query (cart.example.net/ProductDetail.jsp?LISTID=7C0400-1101763508) to a www subdomain (www.example.net/product-category/product). The problem I am facing is the ...
1
vote
1answer
101 views

Godaddy ip canonicalization

I have tried find solution to this all around Google and here, but no luck so far. when I try connect to my website by using IP, it will not redirect to the website. Only godaddy's "Coming soon" page....
3
votes
2answers
59 views

.htaccess configuration

My htaccess file is giving my webpage a 500 error and I do not understand why ... this is the code: AddHandler application/x-httpd-php56 .php RewriteEngine on RewriteCond %{REQUEST_FILENAME} !-f ...
5
votes
1answer
81 views

Looking for explanation of Apache behavior on manipulating headers

Tried to get an answer at ServerFault - they don't know, all real gurus are sitting here. The background of the issue: Googlebot creates non-existing URLs and tries to crawl them. On some URLs Apache ...
1
vote
1answer
175 views

Can .htaccess be changed through FTP after it was edited in WordPress in a way that breaks the site?

I made the mistake of putting in the following code on my .htaccess file thru Yoast SEO: # Remove www from any URLs that have them: RewriteEngine on RewriteCond %{HTTP_HOST} ^www\. RewriteRule ^(.*)$ ...
1
vote
1answer
23 views

Is a .htaccess rewrite rule a potential performance issue?

I use a .htaccess rewrite to redirect: RewriteEngine on RewriteBase / RewriteCond %{REQUEST_URI} !^/redirect-to-this-subfolder/ RewriteCond %{HTTP_HOST} ^(www\.)?domain-to-redirect-to-subfolder-of-...
1
vote
0answers
64 views

Google can't crawl my rewritten URLs

I tried to submit my robots.txt and sitemap.xml for hours now - changing directories and .htacces rules like a horse. For some stupid reason Google can't crawl my pages and gives me warnings, that my ...
2
votes
0answers
27 views

Strange HTTP:Accept-Language behavior instead of Browser Language Detect [closed]

My qTranslate-X (v3.4.6.4) WordPress (v4.4.2) plugin can't "Detect the language of the browser and redirect accordingly.", so i needed to do a hack by .htaccess. Following solution found in Drupal's ....
0
votes
1answer
66 views

.htacess mobile redirect stopped working

My .htaccess mobile redirect code used to work. Now it stopped working. Does anyone know why? Here's the code: rewritecond %{HTTP_HOST} ^www.anumberoneanimalandpestcontrol.com$ [OR] rewritecond %{...
4
votes
1answer
32 views

.htaccess redirect url to a subfolder on a subdomain with exceptions

I have a CMS installed on a subdomain (say blog.domain.com). I created a site on it but the site can be accessed at (blog.domain.com/sites/mysite). I also have to use other links like blog.domain.com/#...
1
vote
0answers
26 views

Using SetEnvIf to not log overly accessed URLs

I'm trying to figure out how to craft my SetEnvIf's in my apache config so that the server hard disk isn't spinning 24/7 over log entries. What I want to do is disable logging for all domains and ...
1
vote
0answers
20 views

Could an .htaccess affect charset options in another directory?

My company is still running a ~12 year old CMS for project management and until yesterday it was working fine. Then I uploaded a version of Tiki Wiki CMS to complete separate folder on the same ...
3
votes
2answers
53 views

Redirecting all pages to new website homepage using .htaccess

I want to direct all of the pages (around 700) from my old website, to the homepage of my new website. I found this method to be used in .htaccess: redirectMatch 301 ^/ http://www.newwebsite.co.uk ...
2
votes
1answer
32 views

Subdomain showing incorrect content when going through HTTPS

I have a domain on my server called example.com and I set up a subdomain called links.example.com. Whenever I go to links.example.com, the domain is pointing to the same directory, even though in the ...
2
votes
2answers
61 views

How do I link to web pages with umlauts in their filename?

I am trying to create an HTML link to a web page hosted on an Apache server that contains umlauts (in my test case it is ä.html). So I tried the following in HTML: <a href='ä.html'>ä.html</...
3
votes
1answer
105 views

.htaccess mod rewrite sub directories redirect loop

I am trying to setup a sub-directory with individual .htaccess. I want to redirect .html files to url without extensions and also add a trailing slash and redirect all non-slashed urls there. Here's ...
3
votes
1answer
36 views

How do I redirect /search/ to /?s=

I have a typical Wordpress site, with a typical Search page set up which uses the typical GET format <form id="searchform" action="http://example.com" method="get"> <input id="s" ...
0
votes
0answers
9 views

Redirect old domain to new domain masking [duplicate]

HOW To Redirect www.OLDDOMAIN.com to www.NEWDOMAIN.com with masking.
3
votes
1answer
50 views

.htaccess wreaking havoc on site root! Help!

I was taught that it is a good practice to separate publicly viewed webpages from included files and other, more sensitive information. That poses a problem, however, when you wish to request index....
5
votes
2answers
77 views

Is a masked 307 redirect for a domain possible?

I've been asked to create a 307 redirect for a domain, ensuring it is "masked". i.e. keep the original URL in the address bar. There isn't a lot of info available about 307 (as opposed to 301/302) ...
2
votes
2answers
88 views

301 redirection from thousands pages to single

I have a tech blog (CCTLD) running from 9 years with thousands of pages (including tags and categories) and i no longer want to continue that blog. And want to get benefit of its SEO value. Now i ...
3
votes
1answer
32 views

htaccess rewrite incoming links to new one

I'm having a problem with site migration and old links. Now, its not just a server migration, it was also a CMS migration. Site went from umbraco (asp.net) to wordpress. Problem is that google indexed ...
2
votes
2answers
104 views

How to Secure Wordpress website using .htaccess , allowing only index.php execution access

I am responsible for security of lots of shared hosting server. We have at least 500 wordpress website in each server. Some of the website owners keep a weak password for WP admin or use vulnerable ...
4
votes
1answer
66 views

How do you block a referer but for a specific URL using .htaccess?

I would like to block a referral URL from a specific domain using .htaccess. The link itself must still function on its own, it is only when the incoming referrer matches. My Site Link: www.example....