0
votes
0answers
27 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
19 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
73 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
38 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
31 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 ...
0
votes
1answer
46 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
0answers
13 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 ...
4
votes
1answer
69 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
1answer
23 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
54 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 ...
1
vote
1answer
68 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 ...
2
votes
5answers
197 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 ...
0
votes
1answer
401 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 ...
2
votes
1answer
88 views

Simplest way to lock down a beta web site but allow paypal payments

Perhaps a strange question, but I have a website that's not ready for production use online in order to test paypal payments. I had locked down the site using a .htaccess file however this also ...
0
votes
0answers
192 views

Remove fb_action_ids of the URL with .htaccess

For some reason my host not let me have more than one htaccess so I have to make all the changes from the htaccess located in the root. My directory tree is as follows: ..../ ....index.html ....css ...
0
votes
2answers
68 views

Apache .htaccess URL rewriting is not working

I am using this code in .htaccess but the last line not giving any response: RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-l RewriteRule ...
2
votes
2answers
62 views

Need help writing .htaccess / Apache rule

I have some URLs which are now 404 due to site upgrade. I want all URLs starting with www.example.com/archives/* to point to www.example.com/news (notice that after archives there is a wildcard ...
2
votes
2answers
142 views

How to prevent JavaScript directory access with htaccess

I have a website like http://example.com but the problem with it is that people are able to get access to my JavaScript by pointing a browser to http://example.com/js/. I have little knowledge of ...
3
votes
1answer
92 views

Moving a WordPress site to a new domain - need help with an Apache htaccess URL rewrite rule

I'm helping to move a WordPress site from one domain to another, which includes a change in permalink structure. I know I can use a .htaccess entry, but I'm not that well-versed (yet) in regular ...
2
votes
1answer
555 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 ...
1
vote
1answer
48 views

Configure htaccess to show index.php as the default page instead of permissions error

Having a problem with my .htaccess. I have this to secure all my documents: Order Deny,Allow Deny from all Allow from 127.0.0.1 <FilesMatch "\.(htm|html|css|js|php)$"> Order Allow,Deny ...
0
votes
1answer
94 views

Perl script rendered in browser as code through symlink - fine when accessed directly

I have a Rails 4 app that has some views that post to Perl cgi scripts. The perl scripts are accessed via a symbolic link to a folder called "cgi-bin". When I navigate to a perl script through the ...
1
vote
1answer
283 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
3answers
107 views

Different authentication for HTTP POST and GET requests in Apache

I want to authenticate for POST requests for http://path/to/logical/abc.xml (but not GET requests to that URL). How do I put constraints like this in place? The paths are logical and location ...
2
votes
1answer
171 views

Restricting post method and authentication to specifc URL paths in Apache .htaccess

I shall start with an example. I want to restrict to POST requests only for http://path/to/logical/abc.xml and restrict to GET only for http://path/to/logical/def.xml. How do I put constraints like ...
0
votes
1answer
185 views

Password protecting dynamic URLs in Apache

I am handling many logical files request using the Apache server. To make the path simple I have used mod_rewrite in the httpd.conf. Now I am planning to enforce authentication on these logical file ...
1
vote
1answer
104 views

How to set up a single IP blocklist for multiple sites hosted on the same account

When running multiple sites on the same hosting account, one might find that an attacker has attempted to breach one site. A webmaster may want to block the IP address from all sites hosted in the ...
1
vote
0answers
156 views

Require domain alias to show in browser address bar

Similar to question posted here (but not related to sub directories): .htaccess redirect of domain name alias to main domain but must show up as the alias domain I am trying to direct traffic from an ...
0
votes
2answers
266 views

301 redirect all pages with a specific extension

I have a website that is not on ASP anymore, it's a Drupal 7 website now. I need to use an .htaccess file to redirect with code 301 all pages with .asp extension to the 404 page or a specific URL. ...
0
votes
1answer
186 views

htaccess redirect pages that don't exist

I have a website that has a little over 100 members. Each member gets a replicated website, and by default the software we use sets up their replicated website at a url like: domain.com/?username ...
1
vote
1answer
186 views

Is there any way to debug redirection rules in.htaccess?

I have an .htaccess file with over 200 redirection rules. It seems some of them are conflicting each other. Is there any way to find out which one is responsible of redirect on a particular request? ...
1
vote
1answer
1k views

.htaccess redirect of domain name alias to main domain but must show up as the alias domain

I have the following in a .htaccess file: RewriteCond %{HTTP_HOST} ^www\.aliasdomain\.com$ [OR] RewriteCond %{HTTP_HOST} ^aliasdomain\.com$ RewriteRule ^(.*)$ ...
0
votes
0answers
12 views

Shorten the URL in apache2.conf [duplicate]

I've just started using apache and I'm trying to change the urls from www.test.com/dashboard.php/page1 to www.test.com/page1 in appache's config file. This has to be done for all URLs so I'm doing it ...
1
vote
0answers
177 views

Is my .htaccess rule creating an infinite loop?

Whenever I type a made up address that includes a directory index it removes it. The problem is when the the address includes a forbidden subdirectory. It reduces itself until it hits forbidden. How ...
1
vote
1answer
169 views

Getting the masked URL values in Mediawiki

I have successfully masked the URL in Mediawiki. By using the following scripts in .htaccess and localsettings.php files in Mediawiki, i.e.: .htaccess: Options +FollowSymLinks RewriteEngine on ...
1
vote
1answer
2k views

How to redirect IP to domain?

My IP xxx.xxx.xxx.xx is pointing to example.com at GoDaddy but I just noticed that when I type the IP in browser, it doesn't redirect to the website, how can do this? I am sure this will happen ...
2
votes
1answer
49 views

Force url to use www [duplicate]

I'm confused about how to force my url to use www in the address. I have a .htaccess code like this: <IfModule mod_rewrite.c> RewriteEngine On RewriteBase / RewriteCond %{REQUEST_FILENAME} !-f ...
2
votes
1answer
620 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
226 views

Rewrite rule for 403

I have an .htaccess file: In this file it redirects to index.php in case a file or directory is not found. My code is as below: <IfModule mod_rewrite.c> RewriteCond %{REQUEST_FILENAME} ...
0
votes
1answer
129 views

Can I redirect the HTTP request towards an old folder to the homepage using .htaccess file?

I have to following situation: I had an old blog that was made using Joomla (this blog was indexed well enough by search engines). For some problems I delete it and I have create it again using ...
0
votes
0answers
278 views

htaccess doesnt work in subfolder

I'm using xampp with apache on my windows machine. My directory structure is: C:/xampp/htdocs ---------------/Sync --------------------/ProtectedFolderA ...
2
votes
1answer
54 views

Handling APACHE file caching

I have used .htaccess to cache images, css and javascript files on my server for up to a month. My problem is that some users get updates that I made recently and all works normally while some user ...
2
votes
3answers
299 views

Clean URLs issue using .htaccess in PHP project

I am working on a PHP laravel project. I am currently facing issues with .htaccess file. I have following .htaccess: <IfModule mod_rewrite.c> Options -MultiViews RewriteEngine On RewriteBase / ...
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: ...
2
votes
0answers
100 views

Replacement for DirectoryIndexRedirect for older versions of Apache

DirectoryIndexRedirect is available in version 2.3.14 and later. (mod_dir) Is there an alternative method for older versions? I have different DirectoryIndex directive sets for a lot of directories ...
1
vote
2answers
187 views

How to setup up .htaccess rewrites for http and https on the same site?

I'm having some issues with htaccess rewrites i need to redirect different parts of my site to HTTPS rather than HTTP, for example login and news sections. I'm not sure how to go about doing this in ...
2
votes
1answer
415 views

How do I use htaccess to make a short URL to a MediaWiki page?

I'd like to rewrite /liam to /index.php/Liam_Edwards-Playne. I've currently written this below in the appropriate .htaccess file but it is still returning a 404: RewriteEngine On RewriteRule ^/liam$ ...
2
votes
1answer
153 views

how to fix .htaccess - redirect http://408.111.1111.domain.us/ to http://domain.us/index.php?w=408.111.1111

We want to use mod_rewrite and .htaccess to do a redirect. How do we redirect http://408.111.1111.domain.us/ and www.408.111.1111.domain.us/ to http://domain.us/index.php?w=408.111.1111 ? If the ...
2
votes
3answers
575 views

How to remove /index.html

How to make redirect /index.html -> / in Apache? Redirect /index.html http://domain-name.com/ Is causeing infinite loop when opening home page.
2
votes
1answer
6k views

Enable 'mod_rewrite' Using .htaccess File On cPanel Shared Hosting Server

I'm using cPanel to host my website. I need to enable 'mod_rewrite' on this Shared Hosting cPanel account to run my script. I've tried to Google the solutions high and low but did not find any luck ...