Directory-level configuration file found mostly on Apache web servers

learn more… | top users | synonyms (1)

0
votes
1answer
194 views

In CakePhP what is the recommended method for having one sub-domain that's outside the CakePhP environment?

I have a CentOS VPS with LAMP installed. I set up CakePhP and I have my httpd.conf set up with 1 virtual host which points to my CakePhP directory. I have various sub-domains in my CakePhP environment,...
1
vote
1answer
668 views

Excluding Facebook Crawler From Following Htaccess Redirects?

I recently made my website https and it's previous url (http) had many Facebook likes which I would like to migrate to the new https url. The only change to the url was the https, no domain change or ...
1
vote
1answer
441 views

htaccess sitemap.xml rewrite to /sitemaps/$_SERVER[“MYVAR”]/sitemap.xml

I am trying to update htaccess to write as following: htaccess sitemap.xml rewrite to /sitemaps/$_SERVER["MYVAR"]/sitemap.xml This rewrite should only occur if sitemap.xml is requested in root (...
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
744 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 ...
9
votes
1answer
4k views

Alternative to .htaccess (due to bad performance)

I've been told that .htaccess should be avoided when possible, as it reduces the server performance and new servers disable it or just don't implement it any more. I don't know how true this is, but ...
0
votes
1answer
45 views

Google not updating title with htaccess expires

It's been 2 weeks I've changed my website title and still Google hasn't changed the title in search engine. I think it's because of if modified since header... my website is generating 201 OK status ...
3
votes
2answers
52 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 ...
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/...
2
votes
1answer
430 views

Apache htaccess - modify query string with mod_rewrite

I've recently changed scripting on my website, and this has resulted in a few 404 errors as some very old queries are no longer being redirected correctly. I've been trying to create a rewrite rule ...
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
2answers
403 views

Redirects On Image Files to Counter Google Image Gallery

The recent update to the way that Google displays images appears to have resulted in a significant drop in the traffic reaching the actual pages of our website. We are considering potential solutions ...
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 ...
3
votes
2answers
58 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 ...
1
vote
1answer
32 views

Why does Apache parse .htaccess if accessed through the main page and not through a VirtualHost?

I have two websites. One is hosted on /var/www (www.example.com) and the other is /var/www/test (test.example.com). The second is a VirtualHost. I wrote a .htaccess (I'm using it to mod_rewrite), put ...
2
votes
4answers
184 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 ...
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 ....
1
vote
2answers
97 views

How to remove Plesk websites temporary urls from Google index?

Google is indexing Plesk temporary URLs, I've tried the following tip but it does not block those URLs. Why Google indexed the preview URL of domain? I added this to .htacess with no success: ...
2
votes
1answer
152 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=...
0
votes
2answers
73 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
530 views

Why doesn't htaccess redirect domain alias to a specific url?

I have this which i can't get to work RewriteEngine On RewriteCond %{HTTP_HOST} ^domainalias.com$ [OR] RewriteCond %{HTTP_HOST} ^www\.domainalias\.com$ RewriteRule ^(.*)$ http://www.maindomain.com/...
2
votes
3answers
554 views

How to remove a prefix from the old filenames and redirect to the new filename?

I have a bunch of old files prefixed with old- (e.g. old-abcde.php). I need an htaccess rule to set up a 301 redirect so that any request for a file starting with old- goes to its corresponding new ...
2
votes
2answers
887 views

How to hide awstats url parameters

currently in order to access statistics on my site I access this link: www.example.com/awstats/awstats.pl?config=awstatsconffile.org all is working fine, but what I want to achieve is simply this: ...
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
396 views

Redirect before rewrite

Had an issue where I need to redirect old URLs, but not disable the mod_rewrite for page structure. redirect 301 /home.html http://www.example.com/ It needs to live on the Symphony 2.0 .htaccess ...
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, ...
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 ...
4
votes
2answers
4k views
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/...
1
vote
3answers
5k views

Remove .php and id from URL and replace with slash

I have tried lots of URL rewrite rules in .htaccess but I am stuck now. I have to change this URL: products.php?id=31 to products/31 I have used: Options +FollowSymLinks -MultiViews ...
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 %{...
3
votes
3answers
30k views

How to set suhosin.post.max_vars in a htaccess file

I need to add this values to my htaccess: suhosin.request.max_vars = 8000 suhosin.post.max_vars = 8000 If I just add them like that I get an Internal Server Error Which is the right way to ...
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
247 views

.htaccess rewrite but keep basic URL

I have basic domain, for example, domain1.com. Also I have domain2.com which is addon domain, and I want to redirect domain2.com to domain.com?parameter=value, which is basically domain1.com, but with ...
4
votes
3answers
2k views

htaccess redirect non-www to www with SSL/HTTPS

I want a rewrite rule that redirects everything to https:// AND www. For example https://example.com should be going to https://www.example.com This is what I have: RewriteEngine On RewriteCond %{...
1
vote
2answers
118 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 ...
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?
2
votes
2answers
2k views

Which method is better to add “www.” before domain name

I have search through Google and found 2 methods to add www before domain name. First is by adding a CNAME and second is using rewrite mod in .htaccess file. I just want to know which method is ...
6
votes
1answer
94 views

301 redirect away from content that is served with a reverse proxy to prevent duplicate content

I am currently struggling to resolve an issue stemming from a reverse proxy. We are running a reverse proxy from page.example.com to example.com/page/ . This original subdomain content is generated ...
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 ...
1
vote
1answer
86 views

How to keep friendly URLs consistent?

I downloaded a site with a crawler script (HTTrack) and now have a few hundred HTML files that need to be edited and re-deployed. The original site ran on a combination of Drupal and a lesser known, ...
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 ...
1
vote
4answers
202 views

Redirect everything from old domain to new domain

I need to (permanent) redirect all of the following: www.domain.com www.domain.com/folder sub.domain.com sub.domain.com/folder Basically all URLS that are reachable without being intended to: www....
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 ...