Tagged Questions

Directory-level configuration file found mostly on Apache web servers

learn more… | top users | synonyms (1)

1
vote
2answers
91 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 ...
0
votes
1answer
220 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
2answers
134 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 ...
1
vote
1answer
43 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
1answer
55 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 ...
1
vote
1answer
319 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 ...
0
votes
1answer
36 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
102 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
114 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
39 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
150 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
95 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
92 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: ...
2
votes
2answers
63 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 ...
1
vote
1answer
99 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
40 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
264 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
97 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
71 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
614 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
59 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 ...
1
vote
0answers
77 views

Setup WordPress multi-site installation to handle both subdomain.example.com and www.subdomain.example.com

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
51 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
140 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
282 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
56 views

.htaccess and 301 redirects .co.uk to .com [on hold]

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
106 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
281 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
208 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
393 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
86 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
133 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
41 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
420 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
52 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
198 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
2k 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
88 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
252 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
149 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
145 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
54 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
346 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
39 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
23 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
6k 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
83 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
60 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
60 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 ...