Directory-level configuration file found mostly on Apache web servers

learn more… | top users | synonyms (1)

1
vote
2answers
46 views

Duplicate content error results instead of a 404 page

My current URL is: www.example.com/category/we-developer/ However, if any user mistakenly adds extra characters after the /, for example, www.example.com/category/we-developer/fgggfgg, it should take ...
0
votes
4answers
65 views

Should error pages be strictly html?

I'm using PHP on Apache server I'm wondering.. If the error pages should best be served as pure and simple html, without database connection etc.? This would remove any chance of ...
2
votes
1answer
668 views

What are the most commonly used and basic Apache htaccess redirects?

This question is here so we can offer users who are looking for information on how to make one or more common or basic redirects in Apache using the htaccess file. All future questions pertaining to ...
1
vote
1answer
102 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} ...
3
votes
1answer
185 views

Site migration and SEO impact

I'd greatly appreciate a response on the following question relating to site migration and SEO impact. Here's some background on how my domain name and site is currently configured: My domain name ...
0
votes
3answers
85 views

Using a front controller design pattern doesn't allow images to be served

I am currently using a front controller. All requests for my website go through it. I have a problem with image links like: <img src="img/image.jpg" /> Then my front controller will try to ...
1
vote
1answer
48 views

htaccess rewrite doesn't work

I'm trying to redirect url's in my /joomla/ folder containing "rsform" to the same url but except for /joomla/ /formulieren/. However my tried .htaccess rewrite doesn't work. I tried: RewriteEngine ...
2
votes
2answers
192 views

Error 404 after rewrite query strings with htaccess

I'm trying to redirect the URLs of a client's website like this: www.localsite.com/immobile.php?id_immobile=24 In something like this: www.localsite.com/immobile/24.php I'm using this rule in ...
0
votes
1answer
185 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 ...
1
vote
2answers
138 views

How can I rewrite a subdomain to go to a specific file in a specific folder?

I've done searching for my answer and have tested a few solutions, but nothing has worked so far. I'm trying to get a URL like this http://baseball.sports.com to rewrite to ...
1
vote
1answer
191 views

htaccess/cPanel 301 redirects not working for add-on domain

I've already looked at many samples and tutorials how to set up those 301 redirects on Apache and can't figure out why some are not working. Whenever I want to redirect any still existing page from ...
0
votes
3answers
87 views

.htaccess rewrite problem for domain

I want to use a particular page in my site as any subdomain. I need something like this http://*.site.com/. So, as the user types http://user1.site.com/ or http://user2.site.com/ then the page must ...
1
vote
1answer
323 views

How to configure mod_bwlimited through htaccess

The mod_bwlimited module in htaccess apparently displays an error if bandwidth is exceeded. Anyone know what options are available for configuring it through htaccess?
2
votes
2answers
114 views

My .htaccess entry is not working

The below are all my .htaccess entry: RewriteEngine on RewriteCond %{HTTP_HOST} !^www\.acethehimalaya\.com$ [NC] RewriteRule (.*) http://www.acethehimalaya.com/$1 [R=301,L] redirect 301 ...
0
votes
2answers
105 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 to example.com. But when I get into the Google Webmaster ...
4
votes
1answer
37 views

Statically mapping a PHP script to another script using an .htaccess file results in 404 errors

After having read a lot of posts on the topic of URL rewriting, I still remain stuck with 404 status errors. My goal: A 'static' rewrite of URLs, as follows (user clicks or enters the one ...
2
votes
1answer
241 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 ...
0
votes
1answer
61 views

Showing content from pages at different URL's (masking), possibly with .htaccess

If I have URL's like:- domain.com/category/widgets/filter/blue domain.com/category/widgets/filter/red And it is pretty difficult to reconstruct them to something like:- ...
1
vote
4answers
39 views

Using a .htaccess to RewriteRule and Redirect 301 at the same time?

I have a couple of specific URLs that I want to display differently on my website, like this: RewriteRule ^contact$ contact.php To get ride of the ".php" extension. And to be SEO friendly (to ...
0
votes
0answers
27 views

Avoid 301 redirect in cdn.domain.mx

I have a domain for HTACCESS redirection problem. With the active CDN the url should be: cdn.domain.mx/images/test.png but redirects me to enter. cdn.domain.mx/images/something.png -> ...
1
vote
1answer
26 views

How can I setup a redirect using an .htaccess that would keep part of the URL path?

I would like to setup a redirect using an .htaccess file which keeps part of the URL's path in the target URL. For example: I have the domain example.com. I want example.com/social to redirect to ...
1
vote
1answer
36 views

How can I create a shorter alias URL to a longer URL using an .htaccess file?

Using an .htaccess file, I want to make one specific URL have a shorter alias like this: Original URL: ...
0
votes
0answers
27 views

non-cachable Canonical redirect of www to non-www

I know this question is debatable for the whole eternity, and most likely nobody knows the real philosophy of this problem. But I'm trying to solve the problem about 301 and 302 response headers in ...
1
vote
1answer
115 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... ...
1
vote
2answers
43 views

Multilingual website without any index file in the root folder

My client has a very simple website with two different languages and I decided to make a separate folder for each language, for example: domain.com/en/ domain.com/de/ But in the root folder there's ...
5
votes
2answers
634 views

How can I disallow access to my website by its IP address?

I want my website to be accessible only by the domain name, not by the server’s IP address. How can I configure Apache to achieve this? Below are the VirtualHost configurations of Apache. ...
0
votes
2answers
69 views

How can I remove the .html extension for static webpages that are indexed so they'll still work in a WordPress site?

I have a static HTML website with less than 100 pages and 99 of them are indexed in Google's search engine. I want to convert it into a WordPress website, but there are some problems I'm worried ...
0
votes
1answer
68 views

Code for redirecting an HTML page without an extension using an .htaccess file results in a 404 error

I'm trying to redirect an HTML page to a WordPress page which has no extension. The result of redirecting example.com/fa/home.html to example.com/fa/ is a 404 page not found. As you can see they're ...
0
votes
1answer
49 views

Google can no longer fetch pages after successful URL rewrites using an .htaccess file

I tried to rewrite my URLs so they no longer have the .html extension. But when I did this (successfully) Google can no longer crawl my pages when I use "Fetch as Google". Instead, it returns 404 ...
2
votes
3answers
2k 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 ...
0
votes
0answers
29 views

htaccess Rewrite changes the URL which I don't want

I use this rewrite rule at my local Apache server: <IfModule mod_rewrite.c> RewriteEngine On RewriteRule ^ellada\/(.*) public/index.php/$1 [L,QSA,NC] RewriteCond %{REQUEST_FILENAME} !-f ...
0
votes
1answer
52 views

301 redirect to the new website but without apostrophes in the URL

I am trying to 301 a page that has a ' in the URL and regular redirect 301 doesn't work. Is there a way to match part of the URL until the ' and use that to 301 to a new page? Example URLs are below: ...
0
votes
1answer
26 views

How to include/install mod_proxy_http.c on JustHost

I'm using a service that requires a URL to be sent to their site so that it can return an HTML snapshot to Googles crawlers. In their .htaccess code it has the line <IfModule mod_proxy_http.c> ...
1
vote
1answer
83 views

301 redirection removes UTM tags from URLs

A page redirects to another page using a 301 redirect in a .htaccess file. If try to access the page from a URL with UTM tagging after redirection, it removes all UTM tagging. Is this normal ...
1
vote
2answers
35 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 ...
2
votes
1answer
283 views

.htaccess rewrite , parked domain on another site to read the proper domain name

I have a parked domain example.co.uk on another domain name web-space in a folder and need to rewrite the domain name in the browser URL as it currently shows the other domain name while browsing and ...
5
votes
1answer
100 views

Restrict access to directories hosting different sites

My hosting provider requires that my primary domain (let's call it example.com) points to my public_html root. I also own several other domains (let's call them exampleA.com and exampleB.com) that are ...
1
vote
1answer
80 views

RewriteRule to send all URLs with `mod` in them to the `moderator` directory

I have a .htaccess file in the root directory of my project, that contains all the rewrite rules for the site to functions. Most of these rules belong to the mod section of the site, and only two of ...
2
votes
1answer
92 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?
2
votes
1answer
45 views

Rewrite up to three folders into three query string parameters to a PHP script

I'd like to use mod_rewrite within the .htaccess file to rewrite folders to a var string. Below is examples of current and what I would prefer. Current URL: example.com/main/folder1/folder2/folder3 ...
0
votes
3answers
32 views

Problem getting rewrite from subdomain to directory to work

I want to redirect demo.example.com to example.com/my-demo. This is my rewrite rule, but I'm not getting it to work on my production server: RewriteCond %{HTTP_HOST} ^demo\.example\.com ...
1
vote
1answer
69 views

Redirect all paginated pages to their main category page

I want to redirect all the paginated pages of the category pages to their respective category pages, because I don't want google to crawl the paginated pages. If my paginated category page URL is: ...
2
votes
1answer
605 views

Apache htaccess results in files being downloaded instead of displayed

So I had this "beautiful" website that did exactly what I wanted it to do. Then I shut down my PC, reboot and...the pages just download now instead of being displayed. I re-installed XAMPP and ...
6
votes
3answers
3k views

Where do I create the file .htaccess, in order to serve my HTML5 cache manifest file correctly?

From a post on http://diveintohtml5.org/offline.html (Wayback Machine Copy) Your cache manifest file can be located anywhere on your web server, but it must be served with the content type ...
0
votes
2answers
41 views

Is using URL parameters bad for SEO? [duplicate]

I recently noticed that my web page have problems with Google and good search results. Many of the existing SEO tools suggests that my website uses bad URLs for SEO. I'm using a single PHP file that ...
0
votes
0answers
17 views

IE not using AES on Website

I hope I chose the right topic this time :) So: I wanted to disable RC4 and "force" PFS on my website. Without modification, every browser used RC4. As I don't have access to the root directory I did ...
1
vote
3answers
3k views

“File does not exist” in Apache error log when mod_rewrite is using

I am getting below error in server log, when re-writing the URLs. [Fri Jan 25 11:32:57 2013] [error] [client ***IP***] File does not exist: ...
1
vote
3answers
46 views

Making a dynamic robots.txt but system is appending forward slash

I am making robots.txt dynamically instead of creating a physical robots.txt file. I am making this from the CMS and the system is appending a forward slash to every page. In the case of robots.txt, I ...
1
vote
1answer
46 views

How can I log a user's actual IP address instead of CloudFlare's?

My raw access log is now filled with CloudFlare IP addresses. Is there any way I can use a .htacess file or configure the server to log the user's actual IP address? With PHP, CloudFlare creates ...
1
vote
1answer
35 views

Changing the Preferred Domain in Google Webmaster Tools resulted in zero stats

I set my Preferred Domain for my website with www in Google Webmaster Tools, then I added the following code to my .htaccess file: RewriteEngine On RewriteCond %{HTTP_HOST} ^example.com$ ...