.htaccess

mod_rewrite RewriteCond based on Last-modified? (.htaccess)

I know that we can easily base a RewriteCond on any http request header. But can we check (some of) the response headers that are going to be sent? In particular, the Last-modified one? I want to rewrite a url only when the Last-modified date is older than 30 minutes and I'm trying to avoid the overhead of delegating that check to a php...

Passing varible types though mod-rewrite

Hello i am having a issue with htaccess mod_rewrite, maybe someone here could point in the the right direction. my site has 1 main file [index.php] all the navigation is done by passing vars in the url string eg index.php?page=about this is working ok with my .htaccess [below] domain.com/about some of the pages have a second variabl...

.htaccess and rewrite of URL

Need help with .htaccess - not able to get what i want... Ugly URL - http://www.onnlist.com/punerealestate.jsp?section=realestate&file=pune Want Better URL (such as) - mysite/realestate/pune/punerealestate.html here is my latest .htacess file - of course this does not work - Options +FollowSymlinks RewriteEngine on RewriteRule ^p...

redirect from subdomain to domain + .htaccess

Hello friends, Is is possible that i can configure RewriteRule for more then one domain. Like my requirement is My current domain name www.maindomain.com and let say i have three domian and subdomain the subdomain url is example1.maindomain.com example2.maindomain.com example3.maindomain.com Now i want when ever user try to access ...

How do I redirect incoming requests from domain.com to www.domain.com via HTTP and HTTPS using .htaccess?

I have the script: RewriteCond %{HTTP_HOST} ^example\.com$ [NC] RewriteRule ^(.*)$ http://www.example.com/$1 [L,R=301] Rewrite rule to redirect /old to /new RewriteCond %{REQUEST_URI} ^/old$ RewriteRule . /new [L,R=301] Which will redirect http://example.com to http://www.example.com, but would like this script to work the same i...

URL rewrite using .htaccess

I am trying to rewrite the URL From ---> http://www.onnlist.com/punerealestate.jsp?section=realestate&file=pune To -----> myserver/realestate/pune/punerealestate.html my suggested .htaccess is ---> Options +FollowSymlinks RewriteEngine on RewriteRule ^([^/]+)/([^/]+)/punerealestate.html /punerealestate.jsp?section=$1&file=$2 [L]...

htaccess in wordpress, problem with sending get data

I have htaccess file : RewriteEngine On RewriteBase / RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^user/([a-z0-9-\s]+)?/$ user/?u=$1 [NC] RewriteCond %{REQUEST_URI} ^user/([a-z0-9-\s]+)?/$ [NC] RewriteRule ^.*$ - RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRu...

.htaccess mod_rewrite on root directory but need it to skip all other directories

Here is the directory outline: / /css /js /admin /config /etc... So this is what I would like: / <-- Mod re-write for this directory only, skip the rest /css /js /admin /config /etc... .htaccess file: # Turn rewrite engine on RewriteEngine On # Set the base path RewriteBase / # now the rewriting rules Rew...

cakephp .htaccess, mime-types

I have a cakephp 1.2 app (1.2.2.8120) and I am trying to change the mime-type for Japanese cell phones on certain pages with this one line of code in the app/webroot/.htaccess file: AddType application/xhtml+xml .xhtml This works for .xhtml files uploaded directly to the webroot folder, but regular cakephp pages don't work. I have tri...

.htaccess + subdomain + redirect

Hello friends, Just wanted to know how we can redirect the subdomain to domain. I have two domain which in pointing to my rails application and a subdomain www.xyz.com www.xyz.info example.xyz.com Now when the user access www.xyz.info the example.xyz.com page should open up but the address bar should be www.xyz.info. So is it poss...

How to create a 301 redirect based on a query string within a subfolder?

I have a .htaccess file in the root of a website: /var/www/mywebsite/htdocs/.htacess and I have some files in /var/www/mywebsite/htdocs/folder/ which are currently generated by index.php?pc=1234 I want to redirect the numbers in the query string variable to static html pages within that folder. I can achieve this in the .htacess f...

.htaccess for cakephp

I'm trying to get a CakePHP application to work. For this, I've set up a brand new Debian installation, updated the configuration and put everything in /var/www, which has the following content: app cake .htaccess index.php vendors The .htaccess file contains the following: <IfModule mod_rewrite.c> RewriteEngine on RewriteRul...

How do you combine these 2 .htaccess RewriteRules into one?

Ok I have another question and I'm a beginner at this. I have this RewriteRule, it redirects the query correctly but doesn't allow me to use the other directories: RewriteRule ^([0-9A-Za-z]+)/?$ /query.php?id=$1 [L] and now this RewriteRule to skip all these directories but now the rule above needs to be commented out for this to wor...

Htaccess Querystring rewrite

I have URLs like /?test that I want to rewrite to /page.php?page=test I tried like this but for some reason it doesn't work. RewriteRule ^\?([a-z0-9\-\+]{3,20})/?$ /page.php?page=$1 [NC,QSA] What am I doing wrong? ...

Deny direct access to all .php files except index.php

I want to deny direct access to all .php files except one: index.php The only access to the other .php files should be through php include. If possible I want all files in same folder. UPDATE: A general rule would be nice, so I don't need to go through all files. The risk is that I forget a file or line. UPDATE 2: The index.php is...

get or post data in jquery (show url on browser line)

hey there :-) Okay, i have a job to do before tomorrow morning.. i'm working on some jquery. Where i load some external file data.. What i really want to know, is how am i going to load some data when i $.post / or $.get some data through jquery Send request into jquery <a href="javascript:;" onclick="$.view.load('prices');">hey ...

Parallel CodeIgniter and Static HTML and htaccess problems

Greetings, all. I am running CI parallel to a static HTML site, with directory structure like so: CI static user_guide .htaccess index.php And I am using the following in my .htaccess file to get the static files. RewriteEngine On RewriteRule ^(application) - [F,L] DirectoryIndex /static/index.html RewriteRule ^([a-z0-9_-]+)\.htm...

htaccess directory

RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^admin/([^/]+)/([^/]+).php website.com/admin/index.php?route=$1/$2 [NS] RewriteRule ^modules/([^/]+)/([^/]+).php website.com/admin/index.php?route=$1/$2 [NS] the above works for when you login. it goes to /admin/modules/catalog but when you click on a l...

Perl: Get .htaccess status on the current folder

I have developed sort of a Server Explorer as a module for our web application, and it actually works great. I am doing some refinements to it and there is one problem I don't really know how to tackle. The Explorer is mainly used to choose pictures from a specified folder and subfolders. As some schools are concerned with distribution...

Solving trailing slash problem for a given setup

Hello, Considering the following rules, how can I rewrite them in order have a trailing slash? I have to mention that I can only edit the .htaccess file, so I have no access to modify the URLs in the website. RewriteRule ^artists/(.*)-p(.*)$ /artists.php?l=$1&p=$2 [QSA,L] RewriteRule ^artists/(.*)$ /artists.php?l=$1 [QSA,L] RewriteRu...