Directory-level configuration file found mostly on Apache web servers

learn more… | top users | synonyms (1)

1
vote
0answers
15 views

Can't get Rewrite rule to keep original URL

I have these Rewrites, but I would like to have the URL stay the same as what is typed originally, I thought removing the [R] flags would stop it but it hasn't RewriteCond %{HTTP_HOST} ...
0
votes
1answer
18 views

htaccess redirect to public folder caught in authentication

I have an .htaccess file at the root of my server which has auth on it. I have a redirect statement that upon entering example.myserver.com instead of myserver.com redirects the user to a sub folder ...
0
votes
1answer
10 views

Reuse values in htaccess to make more flexible code

In a webshop I've build I want to make the imagename more seofriendly. It's now a uniqid(), in my example the filename will be 1243: I've got the following working, I want the htaccess to check the ...
1
vote
2answers
44 views

Enable use of .htaccess

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 dublicates, but none of them helped me yet. .htaccess: ErrorDocument 404 ...
1
vote
2answers
24 views

Change Apache +Indexes language

I have a webpage with Index activated. I have this: Is there any way for change language of this, using .htaccess? I've already tried this Directives: AddLanguage pt .pt DefaultLanguage pt-PT ...
1
vote
1answer
32 views

301 redirect + RewriteRule not working together?

I am using a 301 redirect to redirect a page to another page in the same website, which uses RewriteRule to hide the PHP variables in a friendly URL. My redirection code in .htaccess: Redirect 301 ...
0
votes
1answer
35 views

.htaccess - redirect if visitor is logged into google

I need a .htaccess redirect rule that redirects visitors to a url only if the visitor is logged into google. I was thinking of doing it by looking into cookies RewriteEngine On RewriteCond ...
2
votes
2answers
26 views

HTTP code 403, access denied & Options -Indexes

at "webmasters.stackexchange.com" I already found a similar topic: Stop directory listing using .htaccess and redirect to good error page Options -Indexes ErrorDocument 403 /path/to/403.html ...
1
vote
0answers
23 views

Password protect directory with .htaccess and .htpasswd on direct-admin

In my last cpanel hosting I protect directories by this .htaccess code: Options +FollowSymLinks RewriteEngine on RewriteCond %{HTTP_HOST} ^www.example.com$ [NC] RewriteRule ^(.*)$ ...
1
vote
2answers
48 views

Site migration questions— PHP, link structure & SEO

I'm working on a massive site overhaul and the main structural change will be a move from static HTML to PHP. I work for an art gallery, and having the artist names in URLs is critical. We already ...
0
votes
0answers
22 views

CNAME Access 200 ok / Direct Access 404 Not Found [on hold]

I own the domain example.com. I am hosting my website at example.altervista.org. I have setup a CNAME which transparently redirects example.com to example.altervista.org. How can I issue a 404 Not ...
1
vote
0answers
18 views

line monitoring of phonograms (songs) of radio [closed]

I need to create a monitoring system of phonograms (songs) of radio and television online through streaming so on, but my team and know the way to develop this monitoring system, I know there ...
2
votes
2answers
43 views

Why does .htaccess not prevent a php script from accessing a file

I ran into the following issue: On a website I want to prevent "unauthorized" access to a set of .xml files - the user has to authenticate first. Now it would be possible for an authenticated user to ...
0
votes
1answer
19 views

local install of wp site brought down from host - home page is ok but other pages redirect to wamp config page

local install of wp site brought down from host - home page is ok but other pages redirect to wamp config page. I got all local files from host to www dir under local wamp. I got database from host ...
1
vote
1answer
47 views

Does masking a subfolder with .htaccess have a negative effect on SEO?

My website is physically located at example.com/websitedirectory. I am masking the folder so that the document root folder is redirected to /websitedirectory and the folder is masked, so that it ...
1
vote
3answers
101 views

Remove all content not related to index.html from the web and google

I have seen many suggestions on various redirects, but none were simple and many had no accepted answer. I have a site I wish to completely remove from google and have only my homepage available In ...
1
vote
1answer
48 views

How to noindex a 404 page using .htaccess?

I have several 404 not found pages which I would like to noindex through .htaccess. how do I do it with X-Robots-Tag?
1
vote
1answer
40 views

Htaccess redirect based on country of origin

Can a rule that filters and redirect traffic based on country of origin be implemented in .htaccess? Can it be implemented in any other way then by an IP address? I need the solution to be as ...
0
votes
1answer
33 views

Google still has record of my old site URL - what to do?

I had a blog site, i.e. http://example2.com, then I bought a new domain, i.e. http://example.com and 301 permanent redirected example2.com into example.com. But when I get into the Google Webmaster ...
0
votes
1answer
14 views

Redirect blog archive into certain format

I asked the question in WPSE before, but the answer I got so far is a complicated one. I'm actually looking for a .htaccess way. Here's what the scenario is: My blog archive URLs were like: ...
1
vote
1answer
29 views

Cannot edit .htaccess

So I had some issues regarding my website security and my host provider added this to my .htaccess until I solve the issues: deny from all allow from 10x.xxx.xxx.xxx Now, I solved my issues, but ...
1
vote
1answer
53 views

My Server is returning a 404 instead of 403 when access if forbidden - is it good or bad?

via .htaccess, I forbid access to folders that have no index page inside (domain.com/images for example), and also block my site completely for several user-agents (such as wget). When I test to see ...
5
votes
5answers
976 views

Should I block agent Wget/1.12 (linux-gnu)?

Is that a scraper? It tried accessing my site which is currently password protected for testing purposes. shall I block it?
1
vote
1answer
58 views

Non HTTPS site is indexed as HTTPS in Google Search

I have hosted a site over shared hosting (ipage) and not have setup SSL certificate (which I don't need), but some how Google have indexed it as HTTPS link which popup security error on opening it. ...
3
votes
1answer
112 views

htacess seems to make the page load forever

I need to rewrite a URL of my server so the URL looks friendly. Like: site.com/var1/var2/var3/... to site.com/index.php?page=var1/var2/var3/... So I wrote this .htacess: RewriteEngine On ...
3
votes
1answer
53 views

Make a domain point to another domain

I have never been able to figure out how to do this. I am working on a PHP script. With my script, each user will have access to their own site. For example, the URL for this would be ...
2
votes
2answers
71 views

Unwanted redirect from a domain to my site

An external person from my client company registered a domain and redirected to my client URL. For instance, if you type unwanteddomain.com it redirects to myclientdomain.com. Is there any way to ...
0
votes
1answer
27 views

Masking / mapping URL's with .htaccess

I've recently been trying to come up with a way of masking the visible URL in the browser (so not 301 redirecting) and still show the same content as the original URL. Here is the scenario... ...
0
votes
0answers
31 views

HTTPS redirect to HTTP not working with 'www' subdomain

I have 2 rules on my site: one to force the www subdomain, and another to force the HTTP protocol: RewriteEngine On RewriteBase / RewriteCond %{HTTPS} =on RewriteRule ^ ...
0
votes
1answer
49 views

Is there a “current directory” variable in .htaccess RewriteRule?

In a .htaccess file in the subfolder "/preview" (not in document root), I have this rule: RewriteRule !^public/ /preview/forbidden.php [L,R] It redirects all /preview/"something" requests that are ...
0
votes
1answer
23 views

Geolocalization of my website

I have a big problem with Geoip. My website has the following structure www.domain.com it.domain.com de.domain.com I use the maxmind geoip module in my Apache to redirect users in the appropriate ...
0
votes
1answer
26 views

301 redirect specific URLs

I have a lot of 404 pages looks like that: lalala/lalala/Users_PasswordReminder.aspx?something=lala lilili/lilili/Users_PasswordReminder.aspx /Users_PasswordReminder.aspx?username=admin etc. I ...
2
votes
5answers
184 views

Apache URL rewriting not working

All .php files are rewritted before doing the below rewriting: test.php => test foo.php => foo I want to rewrite this URL http://www.testdomain.com/test?name=john&id=2&nick=doe to ...
2
votes
1answer
56 views

.htaccess port 80 to another port SEO impact?

I am using the Ghost blogging platform. By default to access the blog you go to blog.my-site.com:2368 of course this makes for a ugly, unfriendly URL. I am using .htaccess to change the behavior so ...
0
votes
1answer
113 views

URL rewrite to another folder and file for specific requests

I have following directory structure on my local LAMP: www basic app router.php public index.html .htaccess and I can access my index page with localhost/basic/public/ and I am not using ...
0
votes
1answer
48 views

Shorten URL with Regex

Here's an example URL to a user profile on my site: http://127.0.0.1:8080/overview/showuserprofile/user I want it to be: http://127.0.0.1:8080/user This is what I have for rewrite rules: ...
2
votes
2answers
117 views

How to block user agent from accessing my WordPress site with htaccess?

I have noticed large amount of traffic coming to my site from different IP's with user agent. Mozilla/5.0 (compatible; SiteExplorer/1.0b; +http://siteexplorer.info/) I don't have much experience ...
1
vote
2answers
78 views

Banning IPs through my htaccess doesn't work. Why?

The story is incredibly long. Long story short, someone is using amazonaws IPs for a bot that's clicking on my Adsense ads. I'm trying to ban all amazonaws IPs, but it doesn't work. The bigger problem ...
0
votes
2answers
27 views

Point new domain to existing websites sub-directory?

I have a website (site1.com) that has another site being built within it (site1.com/newsite). My client wants to create a new domain name and have it point to the directory that houses the new site. ...
0
votes
0answers
30 views

Is it possible to forward a domain with one subdomain exception?

I have a www.example.co as my primary domain and a domain example.technology is forwarded to that domain. Now, can I add an exception for subdomain.example.technology to this confuguration? If the ...
1
vote
1answer
94 views

How do I expire by type in .htaccess for remote loaded Google fonts?

Is it possible to set expire by type for remote fonts or Google analytics? I'm getting this report from GTMetrix and everything I've tried isn't working. Suggestions? There are 4 static components ...
0
votes
1answer
28 views

Redirecting a Preview DNS subdomain to a domain with htaccess

I want to redirect all the WordPress urls of the form http://example.com.previewdns.com/my-favorite-post/ to http://example.com/my-favorite-post/ I am trying to do this with the below .htaccess ...
0
votes
1answer
103 views

How to leverage browser cache using .htaccess on nginx?

I'm trying to increase the pagespeed of our website ubercore.co. I'm using PageSpeed Insights for Chrome extension to analyze the pagespeed. It has suggested me to "Leverage browser cache". This is ...
0
votes
1answer
63 views

.htaccess - delete characters from URL and redirect

I need help modify a file .htaccess delete characters from URL and redirect. The file .htaccess is currently empty. I want to change the word article to the word topic in all the URLs. The current ...
2
votes
1answer
67 views

Changing file extensions in URIs - Server Error after Apache upgrade

Please can anyone help to identify flaw or incompatibility in .htaccess code causing server error? In the process of changing over from static to dynamic website, I had to maintain some static files ...
5
votes
2answers
489 views

I am changing my file extensions in URLs, how to keep my good SEO results?

We have a website with good SEO results. For design reasons I have to update the design and I have to change file names from .html to .php. But I keep my domain name! What should I do in order to ...
2
votes
1answer
152 views

Using .htaccess, can you hide the true URL?

So I have a web hotel with 1 main website http://www.myrootsite.com/ and a few websites in subdirectories, in a folder called projects. I have domain names pointing to the subdirectories, but ...
2
votes
1answer
78 views

What do I put in htaccess to create a 410 error page when a URL parameter is present?

I tried to create a 410 error page but realized that I actually created a 302 redirect to a 410.php page. Instead I want to use a 410 error to block out an infinite number of dynamically created pages ...
4
votes
1answer
70 views

Is there any difference, from Google's point of view, on the method used for a 301 redirect?

I have a website with an extremely good Google rank for it's particular niche. I've rebranded and need to redirect to a new URL. In the eyes of Google, what's the difference, if any, between the ...
0
votes
1answer
17 views

How can I rewrite to my .htaccess in PHP? [duplicate]

How to rewrite my URL from http://www.mysite.com/listingsecond.php?ID=1 to http://www.mysite.com/listingsecond? How can I rewrite to my .htaccess in PHP to do this?