Directory-level configuration file found mostly on Apache web servers

learn more… | top users | synonyms (1)

2
votes
1answer
726 views

How to make Htaccess file call external IP block lists?

Well, I don’t know if this is an easy thing to do, but I haven’t figured it out yet. Instead of continually updating my Htaccess file with newly updated country IP block lists (because my htaccess ...
1
vote
1answer
386 views

How can I set a 410 redirect in htaccess

I recently upgraded a website from aspx to a drupal site. I never 310'd 301'd the old pages which are gone. The old aspx pages are still showing up as 404 error in google webmaster. I have created a ...
2
votes
1answer
474 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$ ...
3
votes
1answer
931 views

Force fresh content, not from the browser cache

I used the following code in the htaccess to put my site under maintenance and show the visitors maintenance.html. Options +FollowSymlinks RewriteEngine on RewriteCond %{REQUEST_URI} ...
2
votes
1answer
1k views

How to set htaccess working on opensuse for codeigniter project

I'm trying to have htaccess work on codeigniter project but the module is not working and I don't know how to enable rewrite module. To have read the htaccess. The OS is Opensuse 12.2. I have this ...
5
votes
1answer
7k views

How can I use .htaccess to rewrite different domains to different sub-directories, masking the sub-directory?

I have a shared hosting plan that allows unlimited addon domains, but they can only point to the public root (/). I use .htaccess to point different domains to their corresponding sub-directories. For ...
0
votes
1answer
87 views

Most efficient way to forward domain.com to example.com/subfolder?

Title says my entire question. I think I saw someone forward domain.com to example.com/subfolder and have spent about a week trying to figure out how to best do this.. My goal is to have user type in ...
1
vote
1answer
1k views

Apache2 redirect all sub-directories to index.html of main directory?

I want to put an .htaccess file in a directory of my website. For this purpose in: www.mysite.com/dir/ Then I want anything after /dir/ to direct to /dir/index.html but still display the original ...
2
votes
1answer
96 views

htaccess URL rewriting

I want to redirect a request look like mydomain.com/abc/def to mydomain.com/abc/index.php?q=def where abc is a fixed directory name and def can be any string. How can I do this using .htaccess? ...
2
votes
1answer
66 views

htaccess rewriterule for aliasses

On our main domain we are running a CMS which feeds several domains with different input. The domains are directed with A records to the main ip address. The htaccess works fine it will bring up the ...
2
votes
1answer
159 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 ...
7
votes
1answer
1k views

.htaccess redirect url without trailing slashes

In my htaccess I have some rewrited urls like these: RewriteRule ^first-page$ /subdir/page.php?id_page=1 [QSA,L] RewriteRule ^second-page$ /subdir/page.php?id_page=2 [QSA,L] RewriteRule ^third-page$ ...
2
votes
2answers
458 views

HTACCESS Wildcard Subdomain forward to Domain

I know this may seem like a duplicate, but I am unable to find a solution. Is it possible to setup wildcard subdomains with htaccess? I have an example of http://test.domain.ca I need to forward ...
3
votes
1answer
1k views

In Joomla In htaccess REQUEST_URI is always returning index.php instead of SEF URL

I have installed joomsef version 3.9.9 with the Joomla 1.5.25. Now I want to set https for some of the section of my site(e.g URI starts with /events/) while wanting rest of all urls on http.I am ...
2
votes
3answers
2k views

mod_rewrite works within directory not on root

I am having a problem with my RewriteRule for the querystring portion. What I am able to debug is that the rule is being triggered at least because the page "tags.php" is being rendered but without ...
2
votes
1answer
238 views

Is my .htaccess settings hurting SEO?

I have a site that I have redirecting to HTTPS. I do this to leverage wildcard SSL for my password protected pages. Everything seems to work fine with testing. For example, whether you type in HTTP or ...
1
vote
2answers
293 views

WordPress .htaccess preventing subfolder access

This is sort of a goofy setup, but it's not in my power to reconfigure it at this time. I'm running in a shared hosting environment. The domain is example.com. This is an add-on domain on the host ...
1
vote
2answers
3k views

Make a custom Apache handler (for multiple PHP versions)

I've successfully installed PHP 5.2 and it runs as CGI. (5.3 is my default running on mod, or as the phpinfo says "Server API: Apache 2.0 Handler") Ultimately I want to put something like ...
2
votes
1answer
294 views

htaccess code for maintenance page redirect

I set up a maintenance page that I could enable through an htaccess file. The html file is located in a folder called "maintenance". The html file has some images in it. However, visitors to the page ...
3
votes
2answers
403 views

301 redirect to 404 page?

Currently i'm migrating www. prefix from my urls and use htaccess to do the job. Since we have new software and cleaned database some of the old urls doesnt exists anymore. Therefore some requests ...
2
votes
1answer
92 views

301 re-direct all external links to new domain

I have changed the main domain to a sub-domain & would like to re-direct all external links to the new sub domain. Have read a few articles but having no luck editing the .htaccess as it might be ...
6
votes
2answers
921 views

Allow access to WordPress site only by links in email newsletters

I send out a personal email newsletter, and have been looking into sending it via some service like MailChimp, or sendy.co. Many of these email services suggest, or require, the email newsletter ...
3
votes
1answer
286 views

RewriteRule for URL Subdirectory Root

Have not found this in my searches on SE. I need this scenario to work: • User visits someurl.com/news/folder or someurl.com/news/somefolder/, they get redirected to someurl.com/somefolder. • If ...
2
votes
1answer
2k views

Google Chrome audit: resources are explicitly non-cacheable?

If I run a Google Chrome audit on a site, it lists all CSS, PNG, JPG, JS files and even the main domain (i.e. www.example.com) under the heading: Leverage browser caching The following resources ...
2
votes
3answers
658 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
7k 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 ...
4
votes
3answers
2k views

using .htaccess to redirect .asp to .php?

Ahoy all! I've been racking my brain with this one. I basically just converted all of my pages from ASP code to PHP code. Kept the same filenames. So, here is the htaccess code I have so far, but ...
3
votes
1answer
169 views

301 redirect for a page with a space in it

I have some pages from a client's old template-based site which have spaces in them. For example, one of the pages looks like this: example.com/page.php?domain_name=example.com&viewpage=Gallery ...
1
vote
3answers
1k views

.htaccess 301 redirect with regex?

How to do this with regular expression? Old -> New http://www.example.com/1.html -> http://www.example.com/dir/1.html http://www.example.com/2.html -> http://www.example.com/dir/2.html ...
1
vote
1answer
206 views

Removing 301 redirect from site root

I'm having a look at a friends website (a fairly old PHP based one) which they've been advised needs re-structuring. The key points being: URLs should be lower case and more "friendly". The root ...
2
votes
1answer
116 views

Rewrite catalog/index.php to www.domain.co.uk [closed]

We have an online shop with a welcome page. Our SEO company has asked us to get rid of the welcome page with a rewrite. I am struggling to get this to work. Can you help please? I want to rewrite ...
3
votes
2answers
238 views

How do sites avoid SEO issues and legalities with subdomain unique ids?

I was looking through a few websites recently and noticed a trend I'm not sure I understand. Sites are creating unique referral URLs for customers in the form of: http://customname.site.com (If ...
1
vote
2answers
154 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 ...
0
votes
1answer
134 views

How to ensure apache2 reads htaccess for custom expiry?

I have a site with Apache 2.2.22 . I have enabled the mod-expires and mod-headers modules seemingly correctly: $ apachectl -t -D DUMP_MODULES … expires_module (shared) headers_module (shared) … ...
1
vote
1answer
308 views

google chrome : http authentication issue on iframe

I have an HTML file with 2 links both links are in an iframe to load the contents inside the iframe. I have two protected directories one on the same server and other on another server. If you click ...
2
votes
2answers
288 views

Send 404 Status Code on www.example.com

Does anyone know if it's at all possible (preferably with .htaccess), to send a 404 error code and page when visiting http://www.example.com but have http://example.com working just fine? I want to ...
2
votes
1answer
992 views

Remove multiple trailing slashes in a single 301 in .htaccess?

There is a similar question here, but the solution does not work in Apache for our site. I'm trying to remove multiple trailing slashes from URLs on our site. I found some .htaccess code that seems ...
1
vote
2answers
1k views

Rewrite in Mediawiki, remove index.php, .htaccess

I've just installed Mediawiki on Apache and I want the URL should be: localhost/Main_Page/ localhost/Special:Recent_Changes ... instead of: localhost/index.php/Main_Page/ ...
1
vote
1answer
151 views

Google Indexing Issue after htaccess changes

I have a site called www.FuneralCoverFinder.co.za. I have about 30 pages on the site and usually have 29 indexed. (Excluding 15 blog posts) They are new. I recently upgraded my entire site and made ...
2
votes
1answer
327 views

Seeking .htaccess help: Converting multiple subdomains (both HTTP and HTTPS) to www.domain.com using .htaccess

I've been trying to get an answer to this question on other forums (the folks at SuperUser thought this was the place I needed to post) and via my connections, but I haven't gotten very far. Hopefully ...
2
votes
1answer
785 views

How to redirect requests to another folder using .htaccess?

How to redirect requests to another folder using .htaccess? I have my root directory and my website looks into that directory. I want it to look in the /subdirectory/ instead. I can't modify the ...
3
votes
1answer
226 views

How can I redirect all files in a directory that doesn't conform to a certain filename structure?

I have a website where a previous developer had updated several webpages. The issue is that the developer had made each new webpage with new filenames, and deleted the old filenames. I've worked with ...
3
votes
1answer
213 views

Subdomain In Addon Domain Is Not Working

I added a new addon domain to my cPanel hosting. With the new added addon domain, I try to make some subdomain of it. But, the subdomain is not working like subfolder does. This is my situation: ...
3
votes
1answer
185 views

Stop Apache serving filetypes

Preferably using .htaccess files, though .conf files are an option, is there any way to stop Apache serving certain filetypes? For example, .db shouldn't be served for obvious reason (privacy and ...
5
votes
1answer
701 views

How can redirect pages from old core PHP site to new Joomla site?

We have our old site into core PHP and we have developed it again into Joomla 1.5 last year (because of some limitations we have to build it into 1.5). Now the problem is the URL of sites changed as ...
1
vote
3answers
7k views

How do I do URL re-writes on Plesk?

I am very new to URL re-writing and I am using Plesk which is window-based web server, hence I can't use Apache's mod_Rewrite. Can anyone tell me what is the proper procedure for this?
1
vote
2answers
335 views

How do I redirect www and non but not IP

I am trying to redirect www.domain.com or domain.com to www.domain.com/temp.html I am using the following code: RewriteCond %{HTTP_HOST} ^.*$ RewriteRule ^/?$ ...
5
votes
1answer
703 views

URL masking with .htaccess

I need a hardcore programmer to help me with URL masking. So this is my situation. My website www.michaelfotograf.dk/blog/ is the main site that needs to be configured. I have another ...
2
votes
1answer
267 views

How to hide download file from bots? [duplicate]

Possible Duplicate: How to restrict the download of all files in a folder? I want to make a private file available for download but not use username/password protection. I want to put the ...
1
vote
1answer
187 views

Is it possible to use two different ErrorDocuments for different paths of a website?

I currently run PmWiki at mydomain.com/pmwiki. I have a 404 page and .htaccess set up in my site's document root for 404 pages regarding anything that doesn't have to do with my wiki. By default, ...