Directory-level configuration file found mostly on Apache web servers

learn more… | top users | synonyms (1)

1
vote
1answer
17 views

How to redirect 301 within subdomain?

I have 2 campaigns at competition.example.com/option_1 competition.example.com/option_2 How and where (which .htaccess file) can I 301 redirect from competition.example.com/option_1 to ...
1
vote
1answer
20 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
29 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
83 views

How to redirect Https to Http

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 ...
1
vote
2answers
29 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
40 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 ...
1
vote
1answer
38 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
23 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
59 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
93 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
28 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/ ...
0
votes
0answers
23 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
44 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
84 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
37 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
13 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
39 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
38 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
58 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" ...
3
votes
2answers
50 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
77 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
173 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} ...
1
vote
0answers
59 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
21 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
57 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
30 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 ...
1
vote
0answers
21 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
42 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
31 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
56 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 ...
3
votes
1answer
102 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
32 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
49 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 ...
5
votes
2answers
67 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
84 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
31 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
92 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
63 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: ...
6
votes
6answers
988 views

Removing the dot or period from htaccess files - A dangerous move?

Removing the dot or period from htaccess files (and thus making it unhidden) - A dangerous move? I tried to search in Google with the string: Can I remove the dot htaccess But I didn't find anything ...
3
votes
2answers
124 views

jQuery not loading from CDN

I have a custom CMS, and for some reason jQuery will not load from the CDN. After sitting on this for days, I remember I made a change the the .htaccess file but not sure if it's really the cause. ...
-1
votes
1answer
43 views

I've changed my site's domain, created a redirect, but old URLs result in 404

I've changed the domain of my site, created a redirect, but it seems to work only partially. That is, when I go to example.co.il (old) I do get to example.biz (new). But when I go to ...
1
vote
1answer
59 views

Rewrite rules in .htaccess never take effect and no redirects ever happen

I recently set up a vps with digital ocean to let my site run on php7 and http2 Everything is running great but my sites .htaccess file is not redirecting as it should. I have changed up my ...
3
votes
1answer
85 views

htaccess with regex not working properly!

I can't seem to get the regex in my htaccess redirect working: RewriteRule [\./:_a-zA-Z0-9]*\/(web-browse(r|rs)-benchmarks)[a-zA-Z0-9-/\.:?=]*(|html) /web-browser-benchmarks-firefox-chrome/ [R=301,L] ...
0
votes
0answers
14 views

Redirect site 1 to site 2 from site 2? [duplicate]

We have two web servers: one with domain "www.sitename.com", and another with "home.sitename.com". Is it possible to do a mod_rewrite from the home.sitename.com server htaccess file that would ...
2
votes
1answer
25 views

Redirect all pages within subdirectory to new page

After redoing my webshop, I need to redirect every URL within a certain directoy to a new page. All URLs beginning ith example.com/shop/... should be redirected to the page located at ...
3
votes
1answer
65 views

Creating a Combined 301 Redirect in .htaccess

We are being advised by our SEO agency to reduce the number of "chained" redirects we have. So, for example: URL A - http://www.sitename.co.uk/SHOPPING-CATEGORIES/product_name redirects to its https ...