w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML videos Categories
  Home » HTACCESS » Page 1
Pretty URL with 3 parameters
I have found the answer by mimicking the code above Here is the new version: RewriteEngine On RewriteCond %{THE_REQUEST} /+devplus0/index.php?key=([^&]+)&lang=([^& ]+) RewriteRUle ^ /%1/%2? [L,R] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^([^/]*)/([^/]*)/?$ index.php?key=$2&lang=$1 [L,QSA] RewriteCond %{THE_REQUEST} /+devplus0/index.

Categories : Htaccess

Two different URLs pointing to the same page
RewriteEngine On RewriteRule /process/process-one.html /pages/process-one.html [L] You may need RewriteBase / or some other based on your server config. This htaccess goes in /.

Categories : Htaccess

htaccess rewrite download link
You can do that: RewriteEngine on RewriteCond %{QUERY_STRING} h=(.*)&t=([0-9]+) RewriteRule download/([0-9]+)/([0-9]+)/([0-9]+)/([a-zA-Z0-9_-.]+).zip$ index.php?type=get&y=$1&m=$2&d=$3&packagename=$4&h=%1&t=%2 [NC,L] With - in [ ] !

Categories : Htaccess

301 redirect from legacy site to cakephp site using routes.php and query string
As far as I can tell this is still not supported, I think the follwing ticket is kinda about that issue, not quite sure though: https://github.com/cakephp/cakephp/issues/2120 Unless there is no support for this, you'll have to go with .htaccess, and the one that you should use to handle the redirects is the one in the webroot folder, ie app/webroot/.htaccess.

Categories : Htaccess

.htaccess to nginx conf
Sepcifiy an index file : index index.php. By the way you should put rewrite in locations to avoid the test for every request. It's also better for readability/maitainability. server { server_name domain.tld; root /path/to/root; location ~ /(administrator|public) { index index.php; ... } location / { rewrite ^/$ /public/ last; rewrite ^(.*)$

Categories : Htaccess

htaccess mod rewrite not redirecting automatically
You can have another rule to redirect old URL to new one: RewriteEngine On RewriteCond %{THE_REQUEST} s/+deals(?:.php)??make=([^s&]+)&model=([^s&]+) [NC] RewriteRule ^ /deals/%1/%2? [R=302,L] RewriteCond %{REQUEST_URI} !.(gif|css|png|js|jpg|jpeg|html)$ [NC] RewriteRule ^deals/(.+)/(.+)/$ deals.php?make=$1&model=$2 [L,QSA]

Categories : Htaccess

Htaccess if url starts with
You can do something like this: RewriteEngine On RewriteBase / RewriteCond %{REQUEST_FILENAME} !-d [OR] RewriteCond %{REQUEST_URI} ^/pagesearch/(staticpage1|staticpage2)/ RewriteRule ^ - [L] RewriteRule ^([w-]+)/?$ index.php?page=$1 [L,QSA] RewriteRule ^([w-]+)/([w-]+)/?$ index.php?page=$1&sub=$2 [L,QSA]

Categories : Htaccess

.htaccess parameters - Disallow rule on admin system
The code below solved my dilemma. Basically it looks to see if an actual file / folder exists. If it does then don't do anything. If it doesn't then do its' job. RewriteBase / RewriteRule ^function.php$ - [L] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^(.*)$ function.php?id=$1 [L,QSA]

Categories : Htaccess

Replacing space in url using htaccess
I just did like this and its working for me. RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME} !-f RewriteRule ^([0-9a-zA-Z].+)$ /page.php?title=$1 [L]

Categories : Htaccess

RedirectMatch 301 equivalent in Nginx
It should be : server { server_name mysite.com; location / { rewrite "^/(tf2|cs|dota2|portal|hl|l4d|steam)/([-w]+)/([-w/]+)$" /$1/$3 permanent; } }

Categories : Htaccess

2 simple .htaccess url-rewrite rules
It's difficult to help you, because I don't see your question or your problem... I don't know why you add the www. or not. 1) Redirect notizie/LeDelizieDiCasa to http://www.mydomain.it/?rssfeed=LeDelizieDiCasa with: RewriteRule notizie/LeDelizieDiCasa/? http://www.mydomain.it/?rssfeed=LeDelizieDiCasa [NC,L] 2) Redirect /categoria/Cucina to http://mydomain.it/?categoryfeed=Cucina: RewriteRule

Categories : Htaccess

rewrite url to root directory with url cutting
Unless article.php is able to derive the right article from the title alone, what you want to do is not possible. mod_rewrite is good at rewriting things, but it can't summon an article-id from thin air if it isn't in the original request. You would have something like: RewriteCond %{REQUEST_FILENAME} !-f RewriteRule ^([^/]+).html$ ontent/wefwefw/article.php?article=$1 [L] When you would reques

Categories : Htaccess

htaccess seo-friendly URL's
You can use: # for www.example.com/index.php?page=profile&id=number RewriteCond %{QUERY_STRING} page=([^&]+)&id=([0-9]+) RewriteRule ^ /%1/%2? [L,R=301] # for www.example.com/index.php?page=page RewriteCond %{QUERY_STRING} page=([^&]+) RewriteRule ^ /%1? [L,R=301] And for rewrites back # rewrites back RewriteCond %{REQUEST_FILENAME} -d [OR] RewriteCond %{REQUEST_FILENAME} -f R

Categories : Htaccess

htaccess: rewrite path AND querystring to querystring
P flag is not used for what you want to do. You have to use QSA flag instead (Query String Append) RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^(.*)$ /index.php?src=$1 [L,QSA] Also, make sure mod_rewrite is enabled in your Apache server config (and AllowOverride has the right value to enable htaccess, for example All instead of None)

Categories : Htaccess

set a subdomain with redirect to the index page
You can do that: RewriteEngine on RewriteCond %{HTTP_HOST} ^(?:www.)?sub.abcdefg.it$ RewriteRule .* http://www.abcdefg.it/sub/index.php [R=301,L] Now, you just redirect HTTP_HOST. Before all work well, use [R=302,L] for tests, without cache.

Categories : Htaccess

How to set errors pages when user try to access asset directory without specify file name in Codeigniter?
Create one new htaccess file with the following line and put it in you assets folder. it will display "Access forbidden!" message to user if anyone access directly in browser. Options -Indexes We can restrict to view a files but those assets will not display in website too. so don't try this.it is only needed for your private files in your server as not being used for your website. deny from a

Categories : Htaccess

Two htaccess files in control of one website
look at RewriteCond %{REQUEST_URI} !^domains/ RewriteCond %{REQUEST_URI} !^/domains/ here are you testing if REQUEST_URI does not start with "domains" OR "/domains" however in the previous htaccess, you guarantee that REQUEST_URI will start with www you probably want REQUEST_FILENAME instead of REQUEST_URI here

Categories : Htaccess

How to rewrite if file not found under defined folder
You can use that: RewriteCond %{DOCUMENT_ROOT}/Swastik/public%{REQUEST_URI} -f RewriteRule (.*) Swastik/public/$1 [L] RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME} !-f RewriteRule .* Swastik/library/index.php [L]

Categories : Htaccess

Cloudflare Flexible SSL not working with vanilla Joomla site
It is probably best if you contact support for this issue so we can help figure it out. We've seen a similar issue with WordPress that can be resolved by various plugins available in WordPress. Someone also wrote something up on redirect loops and fixing in .htaccess (don't know if this will help).

Categories : Htaccess

Setup RESTfull api in subdomain only ?
Your question can be answered in two different ways First determine that you want to use subdomains like api.yourdomain.com or subfolders like www.yourdomain.com/api I personally choose SubFolder because of hierarchical tidiness , if you want to read more about them you can Google or see This link After all , if you want to use subfolder , you can do this simply by editing your .htacess l

Categories : Htaccess

301 redirect conflicts with other 301 redirects
You need to keep specific redirects before the generic catch-all ones: redirect 301 /mobile-cars/for-her/kia-moto /kia-12.html redirect 301 /mobile-cars/for-her /cars-for-her/ redirect 301 /mobile-cars/for-him /cars-for-him/ redirect 301 /mobile-cars /cars/ OR using RedirectMatch: RedirectMatch 301 ^/mobile-cars/for-her/kia-moto /kia-12.html RedirectMatch 301 ^/mobile-cars/(for-her|for-him) /c

Categories : Htaccess

Changing coldfusion URL website that contain index.cfm
Okay, there are two methods for what you want to do: .htaccess The trouble here is what you asked to do creates an infinite loop (redirect to /se/friendly/url/ if it's not se friendly, and because you want to be able to parse the string easily, redirect to (without displaying the url change, but that doesn't make a difference for the redirect loop) the ?traditional=url. What, I think, you have

Categories : Htaccess

Htaccess - Rewrite from http to https and www to non-www
You can use this single rule for that requirement: RewriteEngine On RewriteBase / RewriteCond %{HTTPS} off [OR] RewriteCond %{HTTP_HOST} !^www. [NC] RewriteRule ^ https://garrysun.com%{REQUEST_URI} [NE,L,R=301] # rest of your rules will appear below

Categories : Htaccess

HTAccess 301 Redirect Issue with Coldfusion URLs
Just rearrange your rules : Redirect 301 /folder/index.cfm/make/carmake/ /inventory/pre-owned.php?sort=&make=Make&model=&year= Redirect 301 /folder/index.cfm /inventory/pre-owned.php

Categories : Htaccess

htaccess redirect if domain not contain keyword
You can use this code in your DOCUMENT_ROOT/.htaccess file: RewriteEngine On RewriteCond %{HTTP_HOST} ^(www.)?example.net$ [NC] RewriteCond %{THE_REQUEST} !/thisisallowed [NC] RewriteRule ^ http://www.example.net/example/thisisallowed [L,NC,R=302]

Categories : Htaccess

Rewrite condition and rule not working
You don't use tt in the first domain... use: RewriteCond %{HTTP_HOST} ^a[0-3].staging.mydomain.co.jp$ RewriteRule ^(.*)$ http://tt.staging.mydomain.co.jp/$1 [R=301,L]

Categories : Htaccess

Changing domain using Google Webmaster Tools
Make sure you previously added and verified storebuddy.dk in webmaster tools so you can indicate in the change of address tool the new website. Use this rule in .htaccess file instead of the one above: RewriteEngine on RewriteCond %{HTTP_HOST} ^webstock.dk [NC,OR] RewriteCond %{HTTP_HOST} ^www.webstock.dk [NC] RewriteRule ^(.*)$ http://storebuddy.dk/$1 [L,R=301,NC]

Categories : Htaccess

Joomla Custom URL through htaccess
Use the opposite (and without /): RewriteEngine on RewriteRule ^my-team-league/viewgroup/(.+) league/$1 [R=302,L] Try with [R=302,L] and after, when that work well, change for [R=301,L]

Categories : Htaccess

Silverstripe SEO URL - redirect
in _config.php Director::forceWWW(); You also can set it per yml but since you have to flush before it takes effect, it can get ugly to disable it (manually delete silverstripe-cache) in cases when the www-domain does not work. To use one domain I usually use a htaccess-rule. RewriteCond %{HTTP_HOST} ^domain1.com [NC,OR] RewriteCond %{HTTP_HOST} ^domain2.com [NC,OR] RewriteCond %{HTTP_HOST} ^

Categories : Htaccess

Redirect Domain1 to HTTP non-www to HTTPS www - Domain2 without HTTPS htaccess
You can use these 2 rules: RewriteEngine On ## domain1 ## RewriteCond %{HTTP_HOST} ^(www.)?domain1.nl$ [NC] RewriteCond %{HTTP_HOST} !^www. [NC,OR] RewriteCond %{HTTPS} off RewriteRule ^ https://www.domain1.nl%{REQUEST_URI} [L,R=301,NE] ## domain2 ## RewriteCond %{HTTP_HOST} ^(www.)?domain2.nl$ [NC] RewriteCond %{HTTP_HOST} !^www. [NC,OR] RewriteCond %{HTTPS} on RewriteRule ^ http://www.domain

Categories : Htaccess

301 Redirect Links to Use .html Suffix
You could use %{REQUEST_URI} as a condition to negatively match against it, like this: RewriteCond %{REQUEST_URI} !^/search/([^.]+).html$ [NC] RewriteRule ^search/(.*)$ /search/$1.html [R=302,NC,L] I've used 302 in my above example, simple because when testing I always use 302 to make sure its working so I don't get cached, once you confirm its working, you can safely switch it to [R=301,NC,L].

Categories : Htaccess

.htaccess redirect won't execute a specific file
Remove leading slash from 2nd rule and tweak your regex a bit: # some error catching, lets give users more beautiful pages to look at (ja) ErrorDocument 400 /400-badrequest.php ErrorDocument 401 /401-authreqd.php ErrorDocument 403 /403-forbid.php ErrorDocument 404 /404-notfound.php ErrorDocument 500 /500-server.php RewriteEngine on # make sure that all common folders wont be interpreted as time

Categories : Htaccess

Use the question mark in htaccess mode rewrite
You can use this code in your DOCUMENT_ROOT/.htaccess file: RewriteEngine On RewriteBase / RewriteCond %{THE_REQUEST} s/+watch?v=([^s&]+) [NC] RewriteRule ^ watch/%1? [R=302,L] RewriteRule ^watch/([^/]+)/?$ watch?v=$1 [L,QSA,NC]

Categories : Htaccess

Nginx - Unable to secure directory with htaccess nginx
Note that you're trying to use a combination of a path and a url in the location directive. Instead, it should simply contain the relative url after the domain. In your case this is most likely to be: location /folderthatneedsprotection { auth_basic "Restricted Area"; auth_basic_user_file /etc/nginx/passwords/.htpasswd; }

Categories : Htaccess

Using htaccess to validate secure link query string - sub-folders affected
It is because you are flagging every url except index.htm?var=1234 as forbidden You can target only index.htm like this: RewriteCond %{THE_REQUEST} ^.+index.htm.+$ RewriteCond %{QUERY_STRING} !val=1234 RewriteRule ^.* - [F]

Categories : Htaccess

redirect non-www and https to subfolder of the root
Thank you all for your concern. As @anubhava mentioned the problem was with my document root. We revert back the htaccess to what ever it was. and overwrite the DOCUMENT_ROOT in top of the page and it is working: if (strpos($_SERVER['DOCUMENT_ROOT'], '/var/www/websites/dev') !== false) { // OPS(sub-folder) $_SERVER['DOCUMENT_ROOT'] .= '/OPS'; } I would like to over-write document root

Categories : Htaccess

.htaccess redirect secondary domain to primary domain with SSL
You have to use: # redirect to .com RewriteCond %{HTTP_HOST} ^(www.)?domain.co.uk$ [OR,NC] RewriteCond %{HTTP_HOST} ^(www.)?domain.asia$ [NC] RewriteRule ^(.*)$ https://www.domain.com/$1 [R=301,L] with OR, Use this to combine rule conditions with a local OR instead of the implicit AND.

Categories : Htaccess

Using ISAPI-Rewrite htaccess to 301 redirect multiple urls for multiple hostnames?
The check of the hostname is performed in a separate condition, like this: RewriteEngine on RewriteBase / RewriteCond %{HTTP_HOST} ^www.siteone.com$ [NC] RewriteRule ^post/my-old-page-one$ http://www.siteone.com/my-newer-page-one [R=301,NC,L] RewriteCond %{HTTP_HOST} ^www.siteone.com$ [NC] RewriteRule ^post/my-old-page-two$ http://www.siteone.com/my-newer-page-two [R=301,NC,L] RewriteCond %{HTT

Categories : Htaccess

rewrite rule sub directory using .htaccess
You can use this rule in /sub-dir/.htaccess: DirectoryIndex index.php RewriteEngine On RewriteBase /sub-dir/ RewriteRule ^([0-9]+)/?$ index.php?id=$1 [QSA,L]

Categories : Htaccess




© Copyright 2018 w3hello.com Publishing Limited. All rights reserved.