Tagged Questions

Directory-level configuration file found mostly on Apache web servers

learn more… | top users | synonyms (1)

2
votes
1answer
81 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
4answers
38 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
121 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: ...
0
votes
2answers
81 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
1answer
83 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: ...
1
vote
2answers
57 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
0answers
25 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
1answer
82 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
39 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$ ...
1
vote
1answer
233 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 ...
1
vote
1answer
85 views

Use different .htaccess file based on set header from browser

I want to have the ability to test .htaccess rules before saving them to the main .htaccess file. Is it possible to set a specific request header and have Apache use a set of rules from a different ...
3
votes
2answers
69 views

How does one redirect from one wordpress page to another via htaccess?

I tried making the following change to my wordpress site to permanently redirect a common link to a new page. I could've -sworn- that this used to work. But it simply does not (at least in WP 3.9). I ...
1
vote
1answer
522 views

.htaccess URL rewriting friendly URL with 2 parameters, the second parameter is optional

I'm kind of stuck at this part and was hoping that I'd get some assistance. I'm building a highscores page in PHP, that's going great, it works. However, I dislike the idea of index.php?skill=name and ...
3
votes
1answer
54 views

Best way to move site from subdomain to root through cPanel?

I have an old Wordpress blog hosted on a subdomain (sub.mysite.com) with hundreds of posts. The root domain is actually empty and redirected to the subdomain. Now I want to move the site from the ...
0
votes
0answers
69 views

How to prevent a 404 Error when creating a subdomain and using www to access it?

I have installed a multi-site installation of WordPress onto my domain. I then added the necessary code to the wp-config.php file and .htaccess as instructed by WordPress. I also installed a plugin ...
1
vote
1answer
50 views

Confused about redirect and robots.txt

I am updating a site by creating new pages and deleting old ones. To avoid crawling errors should I use both a robots.txt file and 301 redirect on .htaccess? robots.txt: Disallow: /products.php ...
1
vote
3answers
116 views

index.html in subdirectory will not open

I want to have a website structure like this: example.com/ - homepage example.com/solutions/ - this will be the solution parent page example.com/solutions/solution-one - child solution page ...
1
vote
1answer
41 views

Skip part of URL

I have a server running on XAMPP in LAN. In htdocs I've created subfolder called 'apps' (it's because I'm using one CodeIgniter's files to multiple webpages). Now, when somenone want to visit a ...
2
votes
1answer
217 views

Redirect all images in a directory to another website using .htaccess

How can I redirect all .png and .jpg image URLs within the /tool/img directory to another website? Filenames can consist of special (unicode) characters. For example, the following URL: ...
0
votes
0answers
52 views

.htaccess and 301 redirects .co.uk to .com

I want to redirect a .co.uk to .com: example.co.uk/any-file-or-folder and example.com/any-file-or-folder to www.example.com/any-file-or-folder. I've refered to this question/answer: htaccess and ...
4
votes
1answer
100 views

How can I serve all resources under HTTPS instead of HTTP without changing their URLs in the HTML code

I know that by using an .htaccess file I can redirect everyone to https://. However, my SSL certificate complains if all the content isn't served under HTTPS. Is there a way to convert all the ...
3
votes
3answers
271 views

Redirection to load a CSS file

I have in a remote server with this index.html that I can not modify: <link rel="stylesheet" type="text/css" href="styles.css" /> But my styles.css file is not at the web root, that is ...
3
votes
1answer
184 views

301 Redirect a domain to another domain, but keeping the subdirectories the same

Is it possible to configure a top-domain (http://x.com) (DNS/.htaccess/else?) to redirect to another domain (http://y.com), whilst if you navigate http://x.com/subdir/index.html, you'd see the files ...
1
vote
1answer
337 views

Redirect Google crawler to different robots.txt via .htaccess

I have googled for the answer all day and still couldn't find an answer. I have a virtual subdomain www.static.example.com which is a mirror site of www.example.com. It means I have just one root ...
1
vote
1answer
81 views

CDN virtual subdomain causes duplicated content

I have created a subdomain and a CNAME record which points to the domain root. The subdomain www.static.example.com is actually a copy of the entire website www.example.com and it is supposed to act ...
1
vote
1answer
122 views

How to block a spam bot .htaccess proper formatting?

I have downloaded my access log file from my cPanel and found I have a bot I would like to stop. In the access log, there User-Agent string reads the following; 88.80.205.219 - - ...
3
votes
1answer
34 views

Which domain should I authorize in my .htaccess to let google spreadsheet access files on my site

I use google spreadsheet feature that allows one to let an image be the content of a cell. The cell is defined by: =image("http://www.example.com/my-pics/my-pic.jpg") It works pretty well. But, I ...
1
vote
1answer
284 views

Htaccess redirecting 404 URLs to Index page

I am trying to setup my htaccess file such that all 404 pages are permanently redirected to the home/index page using 301. After I configure the htaccess file I try to test that it is working ...
2
votes
1answer
49 views

SEO results in updating periodically a 301 redirect

I'm in the unfortunate situation of managing a very old website, that has been passed by the hands of at least 5 webmasters. Each has implemented new sections and other pages without regarding ...
2
votes
1answer
154 views

How do I do a catch-all .htaccess redirect?

A site has moved from example.net to example.com/ie/en/. (In other words, it’s moved from being its own domain to being a subfolder in a larger site.) However, the page structure has also changed. I ...
1
vote
2answers
1k views

How to disable gzip compression using htaccess

I want to disable gzip compression in my site using htaccess. I have the code below in htaccess: php_flag zlib.output_compression off But it is not working.
0
votes
1answer
85 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:- ...
2
votes
2answers
192 views

Changing from parameter to readable URLs 301 redirect

I've recently changed my URLs with parameters to more readable URLs with the following .htaccess: RewriteRule ^page/([A-Za-z0-9-+_\s]+)$ /index.php?n=$1 [L] RewriteRule ...
1
vote
1answer
136 views

http header rel=“canonical” through htaccess for dynamic content

I have a large number of URLS where I need to specify rel="canonical", The URL structure is like: example.c.o.m/abcd?q=ccccc&location=ffff&x=pp&y=qq I need to strip the last two ...
2
votes
3answers
126 views

Check for URLs that return my 404 error page

I have made a custom 404 error page called error_404.html In my .htaccess I inserted: ErrorDocument 404 /error_404.html In order to control/correct 404 errors in my website, I would like to know ...
1
vote
3answers
53 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
289 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} ...
1
vote
1answer
37 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
20 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 ...
2
votes
4answers
4k 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 ...
1
vote
2answers
77 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
59 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
57 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
48 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
150 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
73 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 ...
1
vote
0answers
20 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
249 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 ...
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 ...
1
vote
1answer
77 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 ...