.htaccess

Help with a form being submitted and .htaccess rule

I use this rule so all URLs have a trailing slash rewriteRule ^(([a-z0-9\-]+/)*[a-z0-9\-]+)$ $1/ [NC,R=301,L] it will convert /about to /about/ The problem is, however, if I submit a form (POST) to /about, when it rewrites to /about/, it loses all the POST info ($_POST in PHP is blank) is there a way to rewrite it for everything exc...

advance url rewriting

how can i change http://www.mydomain.com/down.php?key=1223 to http://www.mydomain.com/?k=1223 i have google it but not found any ans...please help me... i am using apache server with unix ...

Cpanel error log [ client denied by server configuration ]

Hello, This is the first time I visited my error log (in cpanel) and found this: client denied by server configuration: /home/mydomain/public_html/myFolder/index.php3, referer: http://some_domain.com client denied by server configuration: /home/mydomain/public_html/myFolder/index.php4, referer: http://some_domain.com client denied by s...

HTAccess - Confusing clean url's

Hey, If i wanted to simply redirect /clients/page/ to /clients.php?view=page i would use something as simple as this, it works great. Options +FollowSymlinks RewriteEngine on RewriteRule ^clients/([^/]+) /clients.php?section=$1&$2 [NC] If i had for example, a url like: /clients/page/?name=Tom how could i transfer those HTTP GET varia...

Write a .htaccess file in PHP?

On my PHP site I would like to sometimes show a maintenance page to users. I know I can do this in PHP very easily but I would rather use an htaccess file, I think performance may be better this way. So what I am wanting to know is can I modify a htaccess file in PHP? If it is possible I am thinking either, 1 - Have to files and 1 ...

Block user IP's with .htaccess or PHP?

From a performance only view, which would be the best way to block 30 IP addresses? A) .htaccess file or B) PHP code in the file ...

.htaccess for addon domain

I have www.a.com (main), and addon domain www.b.com Structure directory domain b is www.a.com/b.com i want to make .htaccess setting : www.b.com/prod_detail.php?Code=200 and be www.b.com/prod_detail/200 if i sett like this : RewriteEngine On RewriteRule ^prod_detail/([0-9][0-9])/$ /prod_detail.php?Code=$1 not working. Why? Thanks ...

Include file (header) using htaccess

I want to include a certain file with every page-call. For simplicity, assume I have a header which should be pre-pended to every file. (Eg. a php script which checks all sorts of user agent stuff.) I could use mod_rewrite to send all requests to this file, and then use PHP to include the requested page into the file, but that could be...

.htaccess RewriteRule Problem

this rewriterule only rewrite level.php and when try localhost/a/b/115-aaa.html send all requests to level.php but localhost/a/b/ is work why ? RewriteEngine On RewriteRule ^(.*)\/(.*)-(.*).html$ page.php?page=$1&a=$2&b=$3 [QSA] RewriteRule ^(.*)$ level.php?q=$1 [QSA] ...

.htaccess SSL on certain pages

Basically I'm using drupal and can current redirect to an SSL page. But once on that page and continuing navigation all the pages continue over HTTPS. There is a single page I need SSL on and I need to redirect back after you leave that page. Currently I have this: RewriteCond %{SERVER_PORT} !^443$ RewriteRule ^conference https://url/c...

use htaccess to add www with https support

There are a lot of code examples for using .htaccess to add www to a url but they are usually confined to using http. does anybody have an example of how to get it to work in both cases? ...

.htaccess mod-rewrite question

hey there, i have quite some issues with the mode rewrite here is what i use : RewriteEngine On RewriteRule ^([^/]*)/([^/]*)$ /creatii.php?creatie_thumb=$2&user=$1 [L] RewriteRule ^([^/]*)/$ /creatiiuser.php?user=$1 i would like this link : http://creatii.artcrew.ro/creatii.php?creatie_thumb=creatie19&user=dee-dee to look: l...

Where to put .htaccess file?

Hello, I have some settings which I want to use in .htaccess file. The settings are for some functionality at /admin/tool folder level .. but I want to include some settings for /admin and / locations as well. My question is what is the best location to put this file at?? Thanks Update Just fyi .. I want to apply settings like ma...

.htaccess rewriterule redirect to a page in a subfolder as long as the real page nonexistant

FTR, this is most definitely a programmer shortcoming. The problem is that I've got a short url rewriterule on that works fine. I can do www.mysite.com/matt and it'll hit my php page that queries for a result. But what I NEED is to do mysite.com/music/matt When I use the same rule for a subfolder as I did on the root dir, it throws a 5...

htaccess/mod_rewrite doesn't work.

I have tried this but it doesn't seem to work: RewriteCond %{QUERY_STRING} ^?var=10&view=3$ RewriteRule ^/index.php$ http://www.domain.com/index.php?var=11&view=1 [L,R=301] ...

Replace page content before file loads?

Hi! I wanted to know, is there any sory of scripting that I can use so that I can simply change one little thing and then the content will change for multiple pages? Maybe PHP or the htaccess file. What I want to do is make an "Under Construction" page for my website, that I can periodically turn on or off. Right now, the method I am us...

How can I convince mod_rewrite to stay away from my Subversion repositories?

I have a site [hosted on DreamHost], using WordPress for the main content, but Subversion repositories in http://mysite/svn . My file layout is: webroot/ blog # wordrpress files .htaccess My SVN repositories lay outside the web root, but they are correctly mapped to /svn/repository URLs. When I put the WordPress permalink rewr...

Htaccess redirect not working?

Hi! I am trying to use an htaccess redirect, and for some reason when I try to redirect the user, instead of going to page.html, it tries to go to page.htmlpage.htmlpage.htmlpage.html and it just keeps on repeating it. Anyone have any clue what I am going wrong? Here is my htaccess file: IndexIgnore .htaccess */.??* *~ *# */HEADER* */...

Apache mod_rewrite: redirecting subdomains to the HTTPS login page

Hello, I'm trying to accomplish this: http://subdomain.server.com/ should redirect to https://secure.server.com/login?subdomain, but http://subdomain.server.com/any-other-page should pass through as-is. Can I accomplish this in the .htaccess file? ...

Rewrite rule help for several languages

Hi. Could anyone help me here with this rewrite rule please? From this http://www.SOMEDOMAIN.com/en/somefolder/ To this http://www.SOMEDOMAIN.com/frontend/somefolder/?idLang=2 From this http://www.SOMEDOMAIN.com/es/somefolder/ To this http://www.SOMEDOMAIN.com/frontend/somefolder/?idLang=3 (...) And for several other languages...