Directory-level configuration file found mostly on Apache web servers

learn more… | top users | synonyms (1)

1
vote
2answers
53 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
861 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: ...
0
votes
1answer
163 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 ...
1
vote
1answer
590 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 ...
2
votes
2answers
38 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?
1
vote
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 ...
1
vote
1answer
384 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
2answers
70 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: ...
5
votes
1answer
66 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
18 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
21 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 ...
0
votes
1answer
41 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 ...
1
vote
1answer
80 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, ...
2
votes
1answer
368 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 ...
4
votes
2answers
63 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
33 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: ...
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
37 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
32 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 ...
2
votes
2answers
67 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 ...
2
votes
2answers
78 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
42 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
33 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" ...
1
vote
1answer
22 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
1answer
142 views

“Friendly URLs” rule in .htaccess interfering with some directories

My .htaccess is set up to remove .html from URLs as follows: RewriteEngine on RewriteCond %{http_host} ^example.com [NC] RewriteRule ^(.*)$ http://www.example.com/$1 [R=301,NC] RewriteCond ...
5
votes
1answer
73 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 ...
4
votes
3answers
413 views

Googlebot robots.txt access error on HTTPS when redirected from HTTP

This might be a stupid question, but I never came across this issue before and were not able to find any definite answers to this on the web: Our client migrated to HTTPS a few months ago, using ...
3
votes
1answer
70 views

After rewriting URL page not found

I want to rewrite my current URL that is http://localhost/sitename/landing-page/?from=Algeria&to=Afghanistan&submit=Submit to http://localhost/sitename/removals-from-Algeria-to-Afghanistan ...
1
vote
1answer
446 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 ^(.*)$ ...
0
votes
2answers
222 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 ...
3
votes
2answers
116 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
vote
3answers
6k views

Exclude a sub directory in a protected directory

I need to exclude protection on one of the folder inside a protected directory with .htaccess I put .htaccess in here: /home/mysite/public_html/new/administrator/.htaccess The directory need to ...
2
votes
3answers
133 views

How to avoid MP3 downloading sites from using my files?

I have a WordPress site where I'm gonna host files such as MP3s. The thing is I know if I don't do anything, MP3 Crawlers like mp3glu or mp3pleer will come and use my files and bandwidth, which I ...
1
vote
1answer
171 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
21 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
52 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 ...
6
votes
1answer
3k views

.htaccess rule to redirect from 404 to search results

When a user (or a bot) request on non existing page, I want to redirect him to the search results. I prefere to do it with the .htaccess file using something like: ErrorDocument 404 ...
6
votes
4answers
44k views

How to enable use of .htaccess in Apache on Ubuntu?

I'm trying to enable use of htaccess file in Ubuntu 14.04 (Apache 2.4.7). I know that this question has many possible duplicates, but none of them helped me yet. .htaccess: ErrorDocument 404 ...
2
votes
0answers
16 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
48 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
29 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
16 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 ...
3
votes
1answer
94 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 ...
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 ...
0
votes
2answers
923 views

Does it make sense to throw a 404 error with PHP?

Problem Description Hi, The current setting of my .htaccess file does not allow any kind of 404 (as far as I know). I mean, it captures every kind of url like mysite.com/asfasfasf then sends it to ...
1
vote
3answers
146 views

Can secret URLs be used to protect files?

I would like to know if I can offer private downloads in my website (only available to certain users) by placing all the files in a /download folder and make sure it doesn't show the index of all the ...
3
votes
2answers
30 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
2answers
53 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 ...
2
votes
1answer
28 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 ...