Directory-level configuration file found mostly on Apache web servers

learn more… | top users | synonyms (1)

2
votes
2answers
879 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: ...
1
vote
1answer
12 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
19 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
177 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
634 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 ...
0
votes
1answer
27 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 ...
1
vote
1answer
80 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
1answer
408 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 ...
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 ...
2
votes
1answer
392 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 ...
2
votes
1answer
402 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
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, ...
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 ...
4
votes
2answers
4k views
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 ...
2
votes
2answers
91 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
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 ...
1
vote
1answer
27 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 ...
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
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 ...
1
vote
2answers
84 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: ...
3
votes
3answers
29k 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
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
239 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 ...
1
vote
1answer
490 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 ^(.*)$ ...
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
90 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
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?
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
76 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
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 ...
1
vote
1answer
83 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
81 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 ...
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
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 ...
2
votes
2answers
83 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 ...
1
vote
1answer
55 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" ...
2
votes
1answer
143 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
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 ...
4
votes
3answers
429 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
86 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 ...
3
votes
2answers
123 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
141 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
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 ^(.*)$ ...