Directory-level configuration file found mostly on Apache web servers

learn more… | top users | synonyms (1)

1
vote
2answers
54 views

What is .htaccess rewrite rule for humans.txt in the query string?

From http://www.allthingsdemocrat.com/block-bad-bots-in-htaccess.txt: <IfModule mod_rewrite.c> RewriteCond %{QUERY_STRING} http\:\/\/www\.google\.com\/humans\.txt\? [NC] RewriteRule .* - [F,L] ...
0
votes
0answers
13 views

Syntax for Sitewide 301 Redirect from .asp to Wordpress with same file structure/naming [closed]

I'm moving a site over to Wordpress from asp where the file structure and file naming are the same. I can't for the life of me remember the syntax for the htaccess file. Anyone have something like ...
0
votes
0answers
18 views

How to let users add redirects to site without using FTP?

So basically for payments on our site right now we give each client a link that leads to our site, which then leads to a third party payment site. Unfortunately, this creates a new payment page every ...
1
vote
1answer
74 views

Enable gzip compression On Worpress Hosted on Godaddy

I have a site hosted on Godaddy, I need to enable gzip compression on my website as it recommended on speed test, and I have added below content to .htaccess # BEGIN GZIP <ifmodule ...
3
votes
2answers
74 views

htaccess rewrite ignore 2 strings

I have the following rewrite rule to rewrite my old to new URLs: RewriteCond %{REQUEST_URI} !^/activity.*$ [NC] RewriteRule ^(.*)/([0-9]+)/$ /$1/S$2/ [R=301,L] It must also ignore /members, not ...
1
vote
1answer
46 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 ...
0
votes
1answer
15 views

http-basic auth, else placeholder-page

Is it possible to show a http-basic-auth, and when someone fails that test, show a certain HTML-placeholder-page? If so, how can I achieve that?
0
votes
1answer
27 views

Is this a valid redirect-rule return http 301?

I am relaunching a website with over 10'000 pages, must adapt URL a tiny bit and need to be sure my redirect-rules are correct. I simply need to add a "S" before the ID of that particular URL. So ...
0
votes
0answers
14 views

How to Add expiry header on thirdparty JS and CSS file in WordPress

I am using different plugins in WordPress like Disqus comment system, Theia Post slider and other.. Here is a result from GTmatrix : I want to know how can I add expiry header on third party JS ...
1
vote
1answer
42 views

Redirect subdomain to www

I created a subdomain in cPanel and set it to redirect to the www version of my site. The redirecting works insofar as redirecting subdomain.example.com to www.example.com. But when a visitor ...
0
votes
1answer
34 views

How can I get a regular expression to only match an empty string? (In a .htaccess file)

I try to make a regular expression in a .htaccess file, that matches only an empty string. I have tried many things, but it seems like it’s impossible. For example, I tried ^$, but it's looking for ...
1
vote
0answers
21 views

Inconsistent 301 redirects at GoDaddy

I am getting mixed results when using GoDaddy's built-in URL forwarding feature. While these redirects work when using the browser, a test with redirectcheck.com sometimes shows the following result: ...
1
vote
0answers
23 views

Security and Apache Methods

I occasionally get annoying POST requests but one lately caused a 500 error. Not a biggie really, but it got me thinking. My site does not have but one form. Outside of this, POST should not exist ...
1
vote
0answers
21 views

Getting 406 on IE after google redirects my site

I have a wordpress blog. When I search the posts from my site in google, the results appear and on clicking the result I can open that particular post on my site. But while doing the same on Internet ...
0
votes
2answers
46 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
1answer
63 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
0answers
26 views

Redirect query string URL via .htaccess

I am trying to redirect all query strings to a new URL. Search query example www.example.com/?s=cars to resolve to www.example.com/?search_gcse/?q=cars ("cars" is just an example). What is the ...
1
vote
2answers
34 views

How to 301 redirect old domain to new domain on same host with SSL and avoid Privacy Error

Here's the environment: Apache, mod_rewrite.c exists WordPress Two domains that point to the same webhost, we'll call them www.olddomain.com www.newdomain.com We have an SSL Certificate for ...
1
vote
0answers
42 views

htaccess issue with URL masking

I am attempting to mask an URL using an htaccess file to only show the root URL. This is a Drupal 7 website, so I want the URLs to look like the following: Main page: http://www.site1.com Drupal ...
-1
votes
0answers
10 views

Redirecting only homepage using .HTACCESS (And not the subpages) [duplicate]

I have a subdomain - dl.example.com, which serves the downloads on my main domain example.com. But I'd like to redirect the homepage of dl.example.com to the main domain i.e. www.example.com using ...
2
votes
2answers
71 views

How to fix “No Etag header found” error?

I tested my website on ready.mobi and it shows MAJOR FAIL All page assets should use appropriate Etag headers to enable client-side caching and speed up future page loads No Etag header ...
2
votes
2answers
53 views

Would you recommend a 301, 302 or something else?

Ok I have built a resort guide for a summer holiday destination. This is how I have structured the site. www.domain.co.uk/resort-name-a/guide www.domain.co.uk/resort-name-a/nightlife etc. Now, in ...
0
votes
1answer
56 views

Apache / cPanel document root for subdirectory

In cPanel, I'm aware how to set document roots for domains, but I'm trying to have different document roots for a domain depending on the subdirectory. URL | Document Root ...
2
votes
1answer
64 views

Google: Fix Mobile Usability Issues warning - Is Redirect Sufficient?

So recently Google sent out a mass warning to many of us to either fix Mobile Usability Issues on our website or risk having its rankings suffer. Google systems have tested 120 pages from your ...
0
votes
1answer
36 views

Why can't a network access our site? [closed]

So we received an email the other day from a user who has apparently been trying to access our site from their work network for months, to no avail. She's able to get on it with her laptop at home, ...
1
vote
1answer
40 views

apache2 - where/how to put .htaccess files?

I am trying to update/create a .htaccess file for my apache2 server so that my webpages can be accessed without file extensions (e.g. www.example.com/whatis.php can now be accessed as ...
0
votes
1answer
39 views

Google finding non existant URLs on my site and 301 redirects failing

I have been checking webmaster tools and found that Google has picked up some soft 404s. The weird thing is there are no such pages on my site and I dont know how Google has come up with these URLs. ...
1
vote
1answer
45 views

Why Google indexed the preview URL of domain?

I have some problems when the web host updated the plesk desk and the server. I looked to see which pages are indexed site:www.charchas.gr and then I looked for the preview ...
3
votes
1answer
215 views

Hiding folders inside root folder using htaccess

In my server I have the following folder structure and I want to display each folder project link without the folder name. How can I do this? Root Folder -> Subfolder1 -> Project folder ...
2
votes
2answers
166 views

How do I use a htaccess redirect to force www and use the .org domain while maintaining the URL path?

I have found this rule that does about 90% of what I want, but not quite everything. My main goals for the redirect are to 1) force www. 2) redirect .com to .org. This does that, but if I were at ...
2
votes
1answer
75 views

How to remove php extension from pages except search results?

Using htaccess I have these php rules: <IfModule mod_rewrite.c> Options +FollowSymLinks -MultiViews # Turn mod_rewrite on RewriteEngine On RewriteBase / ## don't touch /forum URIs RewriteRule ...
1
vote
1answer
46 views

Block dnsmadeeasy.com due to bad bots?

Should I block dnsmadeeasy.com due to bad bots/sites using their dns service? Would this be a scenario of throwing the baby out with the bathwater?
2
votes
2answers
60 views

Getting 301 redirect error in Google Webmaster Tools while using “change address”

So I'm moving my website from one domain to another. In this process I'm using the "change address" function in Google Webmaster Tools on my old-domain.com, "switching" it to / choosing my verified ...
2
votes
1answer
38 views

Redirect a subdirectory to the main domain in htaccess

I have the folowing structure: www.example.com - DE version www.example.com/de - DE version www.example.com/en - EN version I want to be like that: www.example.com - DE version ...
1
vote
2answers
75 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 ...
1
vote
1answer
33 views

Lowercase 301 Redirects - Site Assets Disappear

I am trying to force all my URLs to be lowercase, but in doing so, I lose the connection to all my site assets. I've added this to my in my .conf file: RewriteMap lc int:tolower And this to my ...
1
vote
0answers
27 views

Cloudflare putting my site in an endless refresh loop

This problem does not happen to all site visitors. The best I can tell, random users of Chrome have the issue but my sample size is way too small to believe that it is only Chrome. However, a few ...
2
votes
1answer
40 views

Redirecting “ugly” urls to pretty ones?

For example to display /id/123 for /urlugly?id=123 I can do RewriteRule ^id/([^/]*)$ /urlugly?id=$1 [L] and apparently for redirect I can add [R] RewriteRule ^id/([^/]*)$ /urlugly?id=$1 [R,L] ...
1
vote
0answers
12 views

What is the proper format for an htaccess redirect relating to https and subdomains [duplicate]

I'm not sure if my syntax is correct here. I'm specifically looking to do this: Redirect all traffic to the root domain (mydomain.com) to a www version (www.mydomain.com). Redirect all http traffic ...
3
votes
1answer
85 views

403 when query string parameter contains an encoded URL

I'm using shared hosting with minimal access to any configuration settings. I've created a more or less empty HTML file, emptypage.html, with the following contents: <!DOCTYPE html> ...
1
vote
1answer
35 views

What is the htaccess code for a clean URL for a user profile page?

I have tried code given on under topic clean URLs using .htaccess, but it is nor working on my website. Actually I am getting static content, but not getting parameters (dynamic content.) My ...
0
votes
1answer
16 views

how to redirect pages to newdomain pages? [duplicate]

hi guys I have a domain named old.com and it has some pages , how can I redirect all those pages to their new address using htaccess? currently only old.com redirects to new.com but old.com/posts/ ...
0
votes
1answer
102 views

403 when query string contains a dot (.) character [closed]

EDIT: did more research, asked new question I dug a bit deeper and realized that the contents of the page are indeed not relevant to this issue. As this question has gotten more and more confusing, ...
0
votes
0answers
12 views

Minimalist RewriteRules but access directories, error pages, etc statically

I am fairly experienced with PHP, but am new to Python. I am generally familiar with mod_rewrite, though I still get mystified by it very often. I am now trying to write a new Python web application ...
1
vote
0answers
27 views

Using .htaccess rewrite rule that doesn't run for specific folders and files

I want to create a .htaccess file that reads index/somepage as index.php?q=somepage. This is how far I got: Options -MultiViews RewriteEngine On RewriteCond %{REQUEST_FILENAME} ...
0
votes
0answers
45 views

How to allow access to subdirectory in website using htaccess?

I am wanting to create a seperate directory for my analytics program to function. My website is www.loosebruce.co.uk and I want my directory to be accessible as www.loosebruce.co.uk/analytics The ...
0
votes
0answers
23 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
37 views

redirecting some parts of a url

ok let me try once again this link [www.mgdezigns.com/cards/festive_silver_purple_ornament_holiday_cards_postcard-239887577090743570.html] needs to be redirected to ...
3
votes
0answers
83 views

.htaccess redirect not working for web alias

I have two domains at one.com: example.com and example.de I would like to redirect from example.com to example.de/en I wanted to use an A record so that example.com points to example.de and then use ...
2
votes
1answer
59 views

Force https and no www using htaccess

This question has been asked a million times before but my problem is that this still doesn't work for me, regardless of what code I use so I was wondering if I could have some help perhaps? This is ...