Все вопросы: [.htaccess]

650 вопросов

похожие теги:
3
голосов
2ответов
4489 просмотров

conditional DirectoryIndex in .htaccess

Is it possible to make the DirectoryIndex value in a .htaccess file conditional based on IP, so that - for example - my IP see's DirectoryIndex as index.html and everyone else sees DirectoryIndex as index.php? Is there a solution other than mod_rewrite?

1
голосов
2ответов
1141 просмотров

Redirect all page requests to one page

I need to redirect all page requests (php, if that matters) on a specific domain to a specific page (again, php) on that domain. I'm looking for a .htaccess, mod_rewrite solution for easy of implementation.

0
голосов
2ответов
162 просмотров

Is it possible to redirect traffic from page that doesn't exist to existing page with .htaccess?

The issue I am trying to solve is that I have a folder with a name that has funny capitalizations, e.g. TeStPage. I would like all requests to my domain, in all versions of caps, redirect to that page. I tried a simple: Redirect /testpage http://www.mydomain.com/TeStPage But that crashed m...

10
голосов
3ответов
4011 просмотров

Symfony: email address as request parameter

I'm having some issues with passing an email address in a url to a symfony app. The url looks like example.com/unsubscribe/email/[email protected] It will always result in a sfError404Exception, except when the period is removed. After doing some googling around, the only solution I've yet seen ...

2
голосов
1ответов
10866 просмотров

Pointing a subdomain to a subfolder using .htaccess

My webhost automatically forwards all requests to *.mydomain.com to the toplevel domain mydomain.com. I wanted to map any subdomain to a specific folder on my toplevel domain. i.e. sub.example.com must be mapped to example.com/someFolder (without change in the address bar). After digging around...

0
голосов
2ответов
194 просмотров

Unable to make a 301 domain redirection

Hi I have an application which uses opencart. I would like to make a 301 reditect in case the user types http://example.com. To be redirected in http://www.example.com (301 status code) Here is my .htaccess content: RewriteEngine On \#OPENCART REWRITES START RewriteCond %{REQUEST_FILENAME} !-...

1
голосов
3ответов
1784 просмотров

OpenCart .htaccess 301 redirect

Using OpenCart how would I use a 301 redirect to add www. to the domain .htaccess content: #Options +FollowSymlinks <IfModule mod_rewrite.c> RewriteEngine On #OPENCART REWRITES START RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^(.*) index.php #OPE...

0
голосов
2ответов
208 просмотров

mod_rewrite needed

lets says I have a domain example.com and I have wildcards dns switched on. on example.com a user can signup with username and password. once registration is done, username.example.com starts redirecting to example.com/script/script.php?user=username. address bar would still show username.example...

2
голосов
2ответов
5763 просмотров

Using mod_rewrite only if a 404 would have occured

I am in the process of converting a static website into one using a cms. I have the cms installed in a sub directory of the public directory. To avoid ending up with ugly domain names (http://example.com/cms/) is there an easy way using mod_rewrite to rewrite http://example.com/… to http://exampl...

1
голосов
2ответов
563 просмотров

Complex htaccess rewrite rules - where do i start?

I have asked on here before about mod_rewrite and got the perfect answer but now I need to do something more complex and really needed the advice of someone who knows mod_rewrite much better. My rewrite rule looks like this so far: RewriteRule ([a-zA-Z_-]+)/([0-9]?) index.php?cat=$1&page=$2...

0
голосов
2ответов
4629 просмотров

htaccess rewriteRule restrict access to one particular folder problem

I have problem with getting the folder inc restricted. It is only the inc folder in the root directory and not the inc folders higher up de hiarchie Problems are: IE will start a download/open dialog and FF displays an include file I don´t have this problem with the images folder wich is ...

1
голосов
2ответов
683 просмотров

not able to 301 redirect url in drupal

i am trying to redirect an url from location a to b using .htaccess with the following code RewriteRule ^accessibility$ http://example.com/topic/accessibility/ [R=301,L] it is not working i have this turned on RewriteCond %{HTTP_HOST} ^www\.(.+)$ [NC] RewriteRule ^ http://%1%{REQUEST_UR...

0
голосов
2ответов
350 просмотров

Reading the .htaccess DirectoryIndex and Rewrites with PHP

Is there an inbuilt way to read the active DirectoryIndex in .htaccess (or httpd.conf etc) with php? Also, is there a way to determine which file the httpd will execute using PHP given a url if rewrites are being used? Basically, given a URL, I want to use PHP to figure out which file the httpd...

1
голосов
2ответов
172 просмотров

How can I rewrite URLs?

I want to convert this URL: mysite.com/cgi-bin/test.cgi/some_random_numbers_and_letters/http/www.somewebsite.com into: mysite.com/www.somewebsite.com I also want to convert this URL: mysite.com/addname.php into: mysite.com/add/ How do I do that?

3
голосов
6ответов
9260 просмотров

Why doesn't Subversion allow to commit .htaccess files?

I can't commit .htaccess files from my Windows SVN client (TortoiseSVN). The error that is returned is: Could not read status line: Existing connection was forcibly closed by the remote host. And here is basically what my vhost looks like in Apache: <VirtualHost *:80> DocumentRoot ...

0
голосов
1ответов
1187 просмотров

Redirect specific file request (at any location) to specific location

I have a specific file, let's call it 'myfile.abc', that I need to have redirected to a specific location, no matter what location it's requested from. For instance: /folder1/myfile.abc /folder2/myfile.abc /folder3/myfile.abc I need all the above to be redirected to (as an example): /myfolder...

0
голосов
1ответов
584 просмотров

start downloading file with ajax

I like to access my download.php with ajax, that way I can show a little downloadscreen in a div, BUT I have this in my htaccess file, that basicly says deny outside access for all pages. I forgot about it, while I was trying to access my download.php file with window.location = urlnieuw Is t...

23
голосов
2ответов
30238 просмотров

Add a header to each request using .htaccess

I want to add a custom header to a phpbb installation without touching the code. (Using .htaccess) The header is: Strict-Transport-Security: max-age=157680000 Any ideas?

2
голосов
1ответов
88 просмотров

creating a default variable in mod_rewrite

I have mod_rewrite take this url: mydomain.com/directory/index.php?slug=slug&year=2009 and make it pretty: mydomain.com/directory/slug/2009/ Easy, but now my issue is, if someone lands at the URL without the year attached (like: mydomain.com/directory/slug/), how can I add the current y...

1
голосов
2ответов
1893 просмотров

Making a .htaccess rewrite rule respect subdirectories automatically

I'm making a downloadable self-hosted web app (using CodeIgniter), and need the .htaccess rewrite rule to be able to tell if it's in a subdirectory or not to be able to make the rewrite rule correctly. For example, if the app is being installed at example.com, then the write rule will look like ...

3
голосов
5ответов
7614 просмотров

redirecting to homepage rather than 404 error page!

I'm working with PHP. I have an .htaccess file like below, and it redirects to homepage rather than 404 error page :/ what can be the problem here? Appreciate helps! thanks a lot! ErrorDocument 404 /new/err404.html RewriteEngine On RewriteBase /new/ RewriteRule ^login.html$ index.php?s=login&am...

0
голосов
3ответов
1078 просмотров

How to encode URL in Apache mod_rewrite?

I'm now doing it this way: rewriterule ^questions/tagged/(.*) qas.php?q=[$1] Which didn't do encoding stuff yet.

0
голосов
3ответов
242 просмотров

How to prevent rewriting href attributes when rewriting urls?

on my web site i want to change url's from (just exemple): site.com/showCategory.php?catId=34 to: site.com/category/34/ Here is the contents of my .htaccess file: <IfModule mod_rewrite.c> RewriteEngine On RewriteRule ^affichage/([0-9]+)$ /affichage/$1/ [R] RewriteRule ^af...

0
голосов
2ответов
6305 просмотров

How Do I make a simple .htaccess internal redirect Catch All script while forwarding POST data?

I just want to catch all requests and forward them internally to my catchall page with all POST data intact Catch all page: http://www.mydomain.com/addons/redirect/catch-all.php I've tried so many combinations, but my server doesn't want to redirect internally if I specify more than catch-all.p...

1
голосов
2ответов
3513 просмотров

.htaccess Redirect to External Site and Forward POST data while Changing address bar?

Hey, I want to use .htaccess to redirect the requested page to the exact same page on a different domain, and I want it to forward all POST data while CHANGING the address bar to the new domain, like a normal redirect. Here's my code. Options +FollowSymLinks RewriteEngine on RewriteRule (.*) ht...

2
голосов
2ответов
6274 просмотров

Htaccess, mod_rewrite and regular expression for alphanumeric and dashes only

Just can't figure aout those regular expressions. I have an .htaccess file with some url rewrites. Look below what I have now: RewriteRule ^news news/ [R] RewriteRule ^news/([-A-z0-9]+)/$ news/$1 [R] RewriteRule ^news/([-A-z0-9]+)$ index.php?news=$1 [L] I don't think this is correct, I mean I...

1
голосов
2ответов
4248 просмотров

mod-rewrite problem in codeigniter

I'm developing a site on my localhost (Usbwebserver application). I'm using CodeIgniter framework: url is "http://localhost/daniel/index.php" with the following options: config/routs: $route['default_controller'] = "site"; config/config: $config['base_url'] = "http://localhost/daniel"; $c...

0
голосов
1ответов
106 просмотров

htaccess rewrite

I am working on a project and it utilizes a shortened url for redirection, I've gotten the following code to work perfectly: XBitHack Off Options +FollowSymLinks RewriteEngine On RewriteCond %{SCRIPT_FILENAME} !-d RewriteCond %{SCRIPT_FILENAME} !-f RewriteCond %{REQUEST_URI} \/([0-9...

2
голосов
1ответов
416 просмотров

Allow a url to avoid a mod_rewrite rule in .htaccess

In addition to web access through my domain names, my ISP allows access to my website thruogh the following format: user.hostname.com, where user is my login name and hostname is my ISP. I have written rewrite rules to automatically remap user.hostname.com to www.mydomain.com, and this works wel...

42
голосов
13ответов
80119 просмотров

.htaccess issues: No input file specified

Can someone help me with this? I'm feeling like I've been hitting my head against a wall for over 2 hrs now. I've got Apache 2.2.8 + PHP 5.2.6 installed on my machine and the .htaccess with the code below works fine, no errors. RewriteEngine on RewriteCond $1 !^(index\.php|css|gfx|js|swf|robots...