FAQ Database Discussion Community


Apache Rewrite does not work

apache,.htaccess,rewrite
I wan't to force non-www but it does not working, here is my .conf from sites-available. <VirtualHost *:80> DocumentRoot /var/www/example ServerName example.com ServerAlias www.example.com <Directory "/var/www/example"> Options -Indexes FollowSymLinks MultiViews AllowOverride All Order allow,deny allow from all RewriteEngine on RewriteCond %{HTTP_HOST} ^www\.example\.com$ [NC] RewriteRule ^(.*)$ http://example.com/$1 [L,R=301] </Directory> ServerAdmin [email protected]..

Replacing the URL on a local page

php,url,rewrite
So I am building a page for a school work and I want to change the URL to match whatever. http://localhost/meet/myprofile.php I want to change it to http://localhost/meet/(username here) or http://localhost/meet/login I want the user changed to whatever is written in the database, but for example let's say $_SESSION['username'] I...

nginx rewrite Issue, why does it just replaces one matched string?

nginx,rewrite
I want to replace my url via Nginx's rewrite directive. For instance, the client side requests http://127.0.0.1/user/user_id/, and I want to let Nginx rewrite the url to http://127.0.0.1/person/person_id/. My Nginx configuration is like this: rewrite (.*)user(.*) $1person$2; But I fount the Nginx changes the url to .../user/person_id/ Could someone tell...

Wordpress custom permalinks

wordpress,.htaccess,rewrite,custom-post-type,permalinks
I've been working on my wordpress permalinks for a couple of days and can't seem to figure out how to get them to work properly. Here is the simple version of what i have and what i'm trying to achieve I have 5 different categories (home, sports, beauty, arts, food)...

Removing last subdirectory from url with htaccess

regex,.htaccess,redirect,rewrite
I am trying to remove the last directory /feed from all urls with htaccess. /feed is added after different subdirectories of the root at different depths and my goal is to keep the entire url regardless its subdirectories except the last /feed. I've tried different rewriterules and redirectmatches without success....

Forcing SSL on signup but removing SSL on non-signup pages

wordpress,.htaccess,mod-rewrite,ssl,rewrite
I am using wordpress and I have the following two functions defined in wp-config.php: define('FORCE_SSL_ADMIN', true); define('FORCE_SSL_LOGIN', true); But I am also wanting to force SSL on a signup page of example.com/signup-page however if I navigate to the signup-page then navigate elsewhere on the website it keeps https enabled unless...

Third party helper override doesn't work

magento,rewrite,override,magento-1.7,helper
I am writing an extension for Magento 1.7 where I need to override a helper from an third party extension. The name of my extension is Mkpreis_Ebay Name of the third party extension: Ess_M2ePro Helper I want to override: Ess_M2ePro_Helper_Module_Renderer_Description My config.xml <config> <modules> <Mkpreis_Ebay> <version>0.0.1</version> </Mkpreis_Ebay> </modules> <global> <helpers>...

.htaccess rewrite - redirect pages

apache,.htaccess,mod-rewrite,redirect,rewrite
I would like to know how could I redirect all visitor who is accessing the following addresses: https://example.com/anypage to https://example.com/search/anypage It cannot redirect people who is already at https://example.com/search/anypage to avoid loop. This is my current .htaccess: Options -Indexes +FollowSymLinks RewriteEngine On RewriteBase / RewriteCond %{HTTPS} off RewriteRule .* https://%{HTTP_HOST}%{REQUEST_URI}...

Redirect all urls ending in “/”

apache,.htaccess,mod-rewrite,seo,rewrite
I need to redirect all URLs ending in "/" to urls that don't end in "/". Example: domain.com/ -> domain.com domain.com/page1/ -> domain.com/page1 domain.com/category1/ -> domain.com/category1 domain.com/// -> domain.com I've tried the following approaches, but none work: RewriteRule ^(.*)\/+$ http:\/\/www\.%{HTTP_HOST}/$1 [R=301,L] RewriteRule (.*)\/+$ http:\/\/www\.%{HTTP_HOST}/$1 [R=301,L] ...

Redirect /{POSTID}/{CATID}/{TITLE} to just /{POSTID}/

apache,.htaccess,redirect,rewrite
I need help with a rewrite / redirect rule to fix some duplicate content issues on my website. I have a URL structure that it causing a ton of duplicate content. The same page can be accessed with: /Static1/Static2/Static3/{POSTID}/{CATID}/{TITLE} /Static1/Static2/Static3/{POSTID}/{CATID}/ /Static1/Static2/Static3/{POSTID}/ So, there are 3 copies of every page. I...

Nginx redirect http subdomains to https

ubuntu,redirect,ssl,nginx,rewrite
I have one domain with 3 subdomains: - example.com (main domain) - api.example.com - blog.example.com - support.example.com (just a cname to point to zendesk) And I have this 3 configuration on my Nginx: api # HTTP server server { listen 80; server_name api.example.com; return 301 https://api.example.com$request_uri; } # HTTPS server...

Apache log: Request exceeded the limit of 10 internal redirects

.htaccess,rewrite,webpage
I have a web page that working ok in a server but in my new server is not working. The Apache Log says "Request exceeded the limit of 10 internal redirects due to probable configuration error. Use 'LimitInternalRecursion' to increase the limit if necessary. Use 'LogLevel debug' to get a...

.htcaccess in Apache not working

linux,apache,.htaccess,rewrite
I enabled mod_rewrite and want to redirect one of my local virtual host websites to google.com for practice. I created an .htcaccess file in my virtual directory (/var/www/example.com/.htcaccess) and gave permissions to .htcaccess by adding the following code to my virtual host's (example.com) config in /sites-available/. <Directory /var/www/> Options Indexes...

.htaccess rewrite $_GET variables

php,.htaccess,rewrite
I have the following page: http://localhost/?news=19&page=2 I want to rewrite this so that it goes kind of as follows http://localhost/news/19/page/2 This is my .htaccess file, but my code dont work :( RewriteEngine ON RewriteBase / RewriteRule ^page/(.*)$ /?page=$1 [L] RewriteRule ^news/(.*)$ /?news=$1 [L] RewriteRule ^news/(.*)/page/(.*)$ /?news=$1&page=$2 [L] ...

Trouble Understanding URL Rewrite to Proxy to Another Server

regex,apache,rewrite
I am sorry if this is really simple and I am not paying attention. I need to redirect a url query (https://1.2.3.4:19999/abc/start?userid={digit string}) to be processed by another server (https://5.6.7.8/operate?service=checkuser&userid={digit string}). So far I've failed to do this correctly (this is my latest attempt): RewriteCond %{REQUEST_URI} ^/abc/ [NC] RewriteCond %{QUERY_STRING}...

rewrite URL to new one

.htaccess,mod-rewrite,url-rewriting,rewrite
My URL is retrieving DB content and the link as below http://mydomain/page.php?id=number&link=newurl And want to have my new URL to be http://newurl FYI: newurl including mydomain Also is there a way to have the visitor visit the page using my new URL, or not?...

Need a specific URL RewriteRule in .htaccess

regex,apache,.htaccess,mod-rewrite,rewrite
I am new to setting up the .htaccess and I would appreciate some help in my problem. If the user hits the following URL (original URL): http://www.example.com/somepage/something I want it to redirect to: http://www.example.com/somepage AND keep the original URL in the browser. So far, I have the following: RewriteRule ^somepage/(.*)$...

Nginx config rewrite with PATH_INFO

php,apache,.htaccess,nginx,rewrite
I create .htaccess file in folder /var/www/project/: <IfModule mod_rewrite.c> RewriteEngine On RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteCond $1 !^(statics/([a-zA-Z0-9\-\/.]+)|index\.php)$ #ignore folder statics RewriteRule ^([a-zA-Z0-9\-\/.]+)$ index.php/$1 [QSA,L] #Add path_info </IfModule> <Files *.php> Order Deny,Allow Deny from all </Files> <Files index.php> Order Allow,Deny Allow from all </Files> index.php: <?php echo 'Path:...

Apache translate simple rewrite rule to plain english

php,apache,.htaccess,rewrite
I want to write the equivalent of some rewrite rules into PHP but am not familiar with them so need an accurate translation into english: RewriteRule ^assets($|/) - [L] RewriteRule ^index\.php$ - [L] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^([^?]*)$ /index.php?path=$1 [NC,L,QSA] As far as I can tell (which...

Need to always redirect to page.php?id=xxxx when an url contains &a=dl

apache,.htaccess,mod-rewrite,redirect,rewrite
I have many different incoming links from across the internet to my website like: http://www.example.com/page.php?id=xxxx&highlight=xxxx%2xxxx&a=dl or http://www.example.com/page.php?id=xxxx&a=dl or any other kind or url you can think of. Only part which is always the same is that the referer url contains "&a=dl". I want to redirect any such incoming url which...

.htaccess Rewrite for PDF file for different domains

.htaccess,rewrite
I have two domains, both domains need a pdf file that can be downloaded but have the same root: http://www.domain.com/test.pdf -> should redirect to /domain_com/test.pdf http://www.domain.eu/test.pdf -> should redirect to /domain_eu/test.pdf I have seriously no idea or clue how to do this. Can someone explain me how this works in...

htaccess - redirect multiples files into subfolders to parent folder

php,.htaccess,redirect,rewrite
I am looking to rewrite the url, like this: From: http://localhost/system/view/mod001/m1_file_01.php (or any file inside mod001) or http://localhost/system/view/mod002/m2_file_01.php (or any file inside mod002) To http://localhost/system/m?_file_01.php I mean, hide/remove the view folder and the (mod001|mod002|mod003|etc) folder, and I have not gotten. This is my folders structure: -system/ .htaccess index.php view/ mod001/...

Nginx. Something like drupal in root and Magento in subfolder

magento,drupal,nginx,rewrite,subfolder
In root directory I have Drupal. In sub directory I have Magento. Most probably drupal rewrites overlap magento rewrites. Magento homepage opening successfully without any nginx config, but links don't work. I'm not sure, but I think to resolve the problem I need exclude magento directory from drupal routing. And...

Using mod rewrite for images

image,mod-rewrite,rewrite
I'm trying to make a rewrite but after trying a lot of solutions, I decided to give up and ask it here. Basically I want to rewrite "example.com/servers/srv_fr/urJq0H.jpg" for example to "example.com/urJq0H". If anyone could help me out, I'd really appreciate it. Thanks...

.htaccess redirect rule same domain but different prefix

.htaccess,rewrite,prefix
I need to redirect following url admin.example.us to myadmin.example.us I have tried different examples using RewriteBase, RewriteRule, RewriteCond. Nothing quite fits my case and my regex seems to fail. Thank you for your help...

wordpress subdomain errors (2 wordpress)

wordpress,.htaccess,mod-rewrite,rewrite,subdomain
So I have an existing wordpress in Domain and installed a completely new wordpress inside a new folder (subdomain) inside the domain folder (domain/subdomain/). Now I want to access this new wordpress using subdomain.domain.com. Was able to do that but then having a problem with images. Was able to fix...

Redirect omitting parameters in .htaccess

apache,.htaccess,rewrite,server
After a couple of hours of fighting, I manage to generate an htacces file to redirect all my old URLs to the URLs of my new site (same domain). I am using the following rules to manage my subfolders redirects (my new site has only a couple of pages): RewriteRule...

Remove site to another domain

.htaccess,mod-rewrite,rewrite
I try remove site to another domain. On the new domain site is located in a subfolder, and i have problem with htacces htacces on my old domain mydomain.com RewriteEngine on RewriteCond $1 !^(index\.php|public|media|robots\.txt) RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^(.*)$ index.php/$1 [L,QSA] New site location is mydomain.com/site/ Links...

For how long a router keeps records in the NAT and can they be reused forwarding requests from other hosts?

udp,rewrite,router,packet,nat
There is an answer explaining in simple terms how a router works translating requests from the local network to outside and back (http://superuser.com/questions/105838/how-does-router-know-where-to-forward-packet) what is not clear - for how long a record in the NAT is kept? For example, if I send a UDP request to 25.34.11.56:3874 and my...

rewrite url from http to https using htaccess

apache,.htaccess,mod-rewrite,redirect,rewrite
I want links with https to forward to http, however they must meet the following condition: Only url in the format https://example.com/non/ and what ever comes after the trailing slash are forwarded to http But links without the /non/ condition remain the same I want to do this using htaccess...

Regex - get last part of url and strip .php

regex,rewrite
I am a little bit confused with that regex stuff. Got some links like this: http://www.test.de/mystuff/otherstuff.php http://www.test.de/mystuff/differentstuff.php http://www.test.de/mystuff/totallynewstuff.php and I want a redirect that leads to http://www.newsite.de/otherstuff/ http://www.newsite.de/differentstuff/ http://www.newsite.de/totallynewstuff/ So far I got this regex ^/(.+?).php?$ and I put this here http://www.newsite.de/$1/ that ends in this url http://www.newsite.de/mystuff/otherstuff/ Close...but not...

How to create rewrite rule to Rename PDF file on the fly while Downloading using nginx?

mod-rewrite,nginx,rewrite
i am working on site where i am allowing users to download PDF files. Each PDF file is stored on server using random hash names, eg. file 768E1F881783BD61583D64422797632A35B6804C.pdf is stored in /usr/share/nginx/html/contents/7/6/8/E/1/768E1F881783BD61583D64422797632A35B6804C.pdf now i can try to give users the direct location of file , but the file name after...

htaccess redirect 301 + rewriterule conflict

.htaccess,redirect,rewrite,redirecting
I have an old domain (old.com) with plenty of dynamic urls and also static urls that are well positioned in google. I have a new domain (new.cat) where the same content has new urls more seo friendly. The old.com site were in a IIS host, so I have transfered it...

Python3 Pysmb Random Access Remote Shared File

python-3.x,random,rewrite,shared,smb
I am working with pysmb library. I know I can retrieve remote shared file using retrieveFile function, and upload local file to remote server using function storeFile. Then is there a way to random access the remote file? For exemple, there is a file called 'test.txt' in the server, I...

Rewrite rule: change a portion of text in URL to another

wordpress,url,mod-rewrite,url-rewriting,rewrite
I want to change the url of my wordpress, I have read that I can make that with rewrite rule but it does not work me unfortunately. Here are the details: I have a wordpress theme, which got me that kind of URL: www.my-theme.pl/portfolio_category/red-flower/ www.my-theme.pl/portfolio_category/blue-flower/ www.my-theme.pl/portfolio_category/black-trees/ www.my-theme.pl/portfolio_category/white-roses/ I want to...

Rewrite rules html/php

php,html,.htaccess,rewrite
I currently have this .htaccess code to remove .php/.html extensions. # Apache Rewrite Rules <IfModule mod_rewrite.c> Options +FollowSymLinks RewriteEngine On RewriteBase / # Add trailing slash to url RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_URI} !(\.[a-zA-Z0-9]{1,5}|/|#(.*))$ RewriteRule ^(.*)$ $1/ [R=301,L] # Remove .php-extension from url RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME}\.php -f RewriteRule...

redirect certain pages to its equivalent in another domain, otherwise redirect to its homepage

apache,.htaccess,rewrite,url-redirection
I want to use htaccess to redirect certain pages to its equivalent in another domain, other pages redirect to homepage. Like that: http://old-domain.com/certain-page redirected to: http://new-domain.com/certain-page http://old-domain.com/another-certain-page redirected to: http://new-domain.com/another-certain-page Only these pages will be redirected, otherwise, pages have to be redirected to the new domain home page. http://old-domain.com/non-certain-page redirected...

Windows Azure: redirect website from www to non-www

redirect,azure,iis,web-config,rewrite
I have this web.config file on my server. <rewrite> <rules> <rule name="HTTP to HTTPS redirect" stopProcessing="true"> <match url="(.*)" /> <conditions> <add input="{HTTPS}" pattern="off" ignoreCase="true" /> </conditions> <action type="Redirect" redirectType="Found" url="https://{HTTP_HOST}/{R:1}" /> </rule> <rule name="Rule" stopProcessing="true"> <match url="^(.*)$" ignoreCase="false" /> <conditions> <add input="{REQUEST_FILENAME}" matchType="IsFile"...

Is possible to rewrite all values in array without for loop in javascript?

javascript,arrays,rewrite
Let's suppose that we have an array (myArray) with data like this: 0: myArray content: 'something' date: '15.5.2015' name: 'Abc' 1: myArray content: 'text' date: '15.5.2015' name: 'Bla' 2: etc ... Now for rewriting all values (into e.g. empty string) of one object properties in this array (for example: 'content')...

Rewrite engine for wildfly

java,java-ee,rewrite,wildfly
I'm wondering if It's possible to use Rewrite engine for Wildfly application server without any third-party library. I have tried to use RewriteValve, but it did not work with Wildfly 8.x If it's not possible, Is there any tiny library to use?...

Nginx rewrite rule without changing url

linux,url,nginx,webserver,rewrite
I need rewrite rule for my nginx server without changing the url. For example : The following link http://example.com/old/path/index.php?cid=XXhhHHnmmm to become : http://example.com/newpath/index.php?cid=XXhhHHnmmm and to point in that specific folder (/old/path). till now I've tried the following which is working if I try opening _http://example.com/newpath: but not working if I...

Nginx config rewrite rule combination

.htaccess,url,nginx,rewrite,config
So I have these 2 rules for url rewrites. location ~ /details { rewrite ^/details/(.*)/(.*)/(.*)/(.*)_(.*).html$ /site/$4.$5.html permanent; rewrite ^/details/(.*)/(.*)/(.*)/(.*)_(.*)_(.*).html$ /site/$4.$5.$6.html permanent; } But for some reason the first one on its own works just fine but the second one will not pick up. Is there a way I could combine...

URL Rewrite Doesn't Work as Expected - Hide svc extension

c#,wcf,rewrite,isapi
I'm new to URL Rewrite. I created a WCF Rest service, and I'm trying to set a rewrite rule that will allow invoking the service when the svc extension is hidden. I have a method named "Test" on that service, that I invoke successfully with the svc extension present. What...

NGINX - Return vs Rewrite

redirect,nginx,return,rewrite
I use NGINX in my dedicated server. I've a question, with the return and rewrite 301. Rewrite 301: rewrite ^ http://xxx.xxxxx.net/xx-xxx/$request_uri? permanent; Return 301: location ~ redirect-this/?$ { return 301 http://xxx.xxxxx.net/xx-xxx/redirect-this$1; } All redirect correctly to the URL requested. But.. What is more effective method, to make an 301 redirect?...

RewriteRule to remove version number

apache,.htaccess,mod-rewrite,redirect,rewrite
I have implemented a cache busting solution on a site where a version number is added to the end of the file name, before the file extension. However I am having an issue with one of the rules not working. Typical requests: /static/deploy/styles/site_78_direct.min.0.css /static/deploy/styles/ie/site_78_direct.0.css I need the above to be...

Prevent extension automatically added at the end of url (htaccess ?)

.htaccess,url,rewrite
When I go to www.mysite.com/page the browser find www.mysite.com/page.php How to prevent that ? If I go to www.mysite.com/page I want a 404 error. And not this page : www.mysite.com/page.php or this : www.mysite.com/page.html EDIT I have something like this in my htaccess : RewriteRule ^/?page/(.*)/?$ page.php?name=$1 [L,QSA] And when...

redirect WP post from one subdomain to WP page on domain subdirectory using htaccess- file

wordpress,.htaccess,rewrite,subdomain,subdirectory
I got a issue with my htaccess-file. I learned a thing or two when it comes on rewriting through the htaccess-file, but this one is really keeping me awake. Hopefully one of you can help me solve with this matter. The situation is the following. I want to redirect some...

Creating an SEO friendly URL with Htaccess File

.htaccess,mod-rewrite,url-rewriting,seo,rewrite
I am trying to setup an SEO friendly redirect, but need to be using my .htaccess in a specific way. Here is what my URLs look like right now: http://www.mywebsite.com/report/index.php?id=38678a80dfea5924 I need to change the URLs so that they look like this: http://www.mywebsite.com/report/38678a80dfea5924 I've read several tutorials about creating SEO...

How to get an .htaccess rewrite rule with filtering directory and keeping parameters [duplicate]

php,apache,.htaccess,mod-rewrite,rewrite
This question already has an answer here: mod_rewrite - PHP: $_GET not complete 1 answer I'am trying to write a rewrite rule and I would like to change this: http://domain.de/adServer/js/first/sec/ADTECH?loc=300&alias=Home&misc=1429871690242 to: http://domain.de/adServer/js/ADTECH.php?a=$1&b=$2 where $_Get in ADTECH.php shout be: $_GET['a']=first | $_GET['b']=sec | $_GET['loc']=300 | $_GET['alias']=Home The .htaccess-file will be...

How bad is $wp_rewrite->flush_rules() on 'init' action hook?

wordpress,performance,rewrite
According to the Codex: [...] This function can be extremely costly in terms of performance. It should be used as sparingly as possible - such as during activation or deactivation of plugins or themes. Every attempt should be made to avoid using it in hooks that execute on each page...

How to process argument with dot in .htaccess?

regex,apache,.htaccess,apache2,rewrite
I have this rule list in .htaccess: RewriteEngine on #RewriteCond %{REQUEST_URI} \/([0-9a-z&=\.\[\]{}%-]+)$ [NC] RewriteRule \.incl$ - [R=404] RewriteRule \.dist$ - [R=404] RewriteRule ^handler/.*$ handler/handler.php? [L] RewriteRule ^appsflyer/(.*)$ appsflyer.php$1 [L] RewriteRule ^testlead/.*$ testlead/testlead.php? [L] RewriteRule ^special/(.*)$ special/terminal.php$2 [L] #RewriteCond %{REQUEST_URI} \/([a-zA-Zа-яА-Я0-9_[\]{}%&=-]+)$ [NC] #RewriteRule ^(.*) /link_handler.php?query=%1 [L] RewriteCond %{REQUEST_URI}...

Can not rewrite slash rule in htaccess

.htaccess,web,rewrite,slash
I've done a lot of research and this is not a duplicate question. I need to add code in the htaccess to open my page from site.com/page and site.com/page/ to open the same page. There are many codes for this but it won't work for me because I already have...

how can you specify the length of an hatccess rewrite

.htaccess,rewrite
If I'm doing a rewrite, is there a way to distinguish between the string length, like if it's 2 characters, it goes to one page, but if it's 3 or more, it goes to another one? RewriteRule ^([a-zA-Z0-9]+)/?$ two-characters.php?u=$1 [QSA] // 2 char RewriteRule ^([a-zA-Z0-9]+)/?$ three_plus_characters.php?u=$1 [QSA,L] // 3+ char...

.htaccess doesn't redirect direct link to .php files

php,.htaccess,redirect,rewrite
This is my current .htaccess file: DirectoryIndex requestHandler.php RewriteEngine on RewriteBase / RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^(.*)$ requestHandler.php?/$0 [L,QSA] I want to redirect alle requests to "requestHandler.php". It works now, but it is also possible to access sites with the direct link, and I don't want that....

use image/media/binary file for directory index (or pretty URLs for images/media)

image,apache,.htaccess,mod-rewrite,rewrite
for most web/http servers, the default is to return a file of the name index.{html,php} if a directory is specified in a path and contains the index file. i am wondering if it is possible to return an image or some other content instead of the index file? e.g. for...

HTACCESS Profile Redirection Regex Not Substituting

php,.htaccess,rewrite
My goal is to rewrite URLs requesting a specific profile from the form profile/name to a PHP script that will take name into itself and spit out this person's profile. To accomplish this I use the following statement: RewriteRule ^profile/([^/]+) profile/view.php?username=$1 [NC] The problem is that no matter what I...

Rewrite URL to get contents from sub-directory

.htaccess,mod-rewrite,rewrite
I have edited my /etc/hosts file to link domain.com to my localhost. Now when I visited domain.com I want it to get the site contents from domain.com/site/ but only using the URL domain.com thus removing site/ from the URL. I have done this once before, so I know it's possible,...

nginx limit_req does not work

nginx,webserver,rewrite,rate
I'm trying to implement a simple rate limiting system with nginx (v1.6.2) sites-available/mysite.com: limit_req_zone $binary_remote_addr zone=myzone:10m rate=2r/m; server { listen 80; server_name mysite.com; root /var/www/vhosts/mysite.com; error_log [..]; access_log [..]; include conf.d/php-fpm.conf; location = / { limit_req zone=myzone burst=3 nodelay; index index.html; } location / { try_files $uri =404; } location...

Unicode Characters in htaccess rewrite

php,.htaccess,unicode,rewrite
Iam Using URL Re Write in .htacces File. Below is The Exact code. its Working Fine. But While i pass Unicode characters in arguments [ie: mypage.php?id=2&ampname=தமிழ்]. it shows some code like '%25E0%25AE%25A8%25E0%25AE%2' and Result is Page Not Found 404. Can anybody Solve this issue? RewriteEngine on RewriteCond %{THE_REQUEST} /mypage\.php\?id=([^\s&]+)&name=([^\s&]+) [NC]...

Rewrite Rule For Base Directory

.htaccess,redirect,url-rewriting,rewrite
So I'm trying to rewrite the following example. Took a look around but couldn't find the correct post that matched this scenario. Here is a list of layout for old pages: www.url.com/directory www.url.com/directory/page1.html www.url.com/directory/page2.php I'm trying to rewrite the following way through htaccess: Redirect 301 /directory /newdirectory Redirect 301 /directory/page1.html...

How to write my rewriterule so I can have friendly url

.htaccess,seo,rewrite,opencart,friendly-url
My SEO expert asked me to do HTTP 301 redirect to a friendly URL in an Opencart installation. This Opencart installation use SEO url so I have this url (native url in opencart) : http://www.qcbikeshop.com/index.php?route=information/information&information_id=9 and the SEO url is : http://www.qcbikeshop.com/Livraison-Gratuite However, my SEO expert want me to do...

.htaccess URL-Rewrite solution?

apache,.htaccess,mod-rewrite,url-rewriting,rewrite
I need to rewrite my url using .htaccess The url is http://www.domain.com/subfolder/search-brands/index.php/?q=Garment Bags&brand=traveler apos s choice And i want it to work like this http://www.domain.com/subfolder/search-brands/Garment Bags/traveler apos s choice Anyone can make it? Thanks a lot for your help!...

nginx rewrite rule php melody

.htaccess,nginx,url-rewriting,rewrite
I am using nginx. I want to rewrite urls. My code: rewrite ^/([^/]*)_([a-zA-Z0-9]{9}).html$ /watch.php?vid=$2 last; Example of url: http://104.238.130.170/hudson-against-the-grain-video_14a4e06f8.html But when I save file then restarts nginx server i got error: [emerg] directive "rewrite" is not terminated by ";" in /etc/nginx/conf.d/default.conf:46 QUESTION: What is wrong on my rewrite rule? rewrite...

Domain Rewrite for both HTTP and HTTPS in IIS 7

redirect,iis-7,web-config,rewrite,isapi-rewrite
I want to do a number of 301 redirects in one request and I found this article to be helpful. However, I have a problem where http://example.com redirects to https://www.example.com BUT https://example.com DOES NOT redirect to https://www.example.com So here are my examples: SEO - remove default.aspx (works fine but no...

RewriteRule : How can i handle my url

php,.htaccess,mod-rewrite,redirect,rewrite
I need Rewrite code for my .httaccess file where i can froward my url to specific folder default page. LIKE if the following url not found: www.domain.com/abc/23/121/ >>> www.domain.com/abc/default.php OR www.domain.com/xyz/23/121/ >>> www.domain.com/xyz/default.php What ever first folder, it will redirect to its folder default file. How can I forward URL...

Force https redirect on all http requests on IIS

asp.net,https,rewrite,iis-7.5
I want to force all http requests to redirect to https, so I now have this rule: <rules> <clear /> <rule name="force https" stopProcessing="true"> <match url="(.*)" /> <conditions logicalGrouping="MatchAll"> <add input="{HTTP}" pattern="on" ignoreCase="true" /> <add input="{HTTP_HOST}" pattern="(sitea\.com)|(sitea\.uk)|(sitea\.org)" negate="true" ignoreCase="true" /> </conditions> <action type="Redirect" url="https://{HTTP_HOST}{REQUEST_URI}" redirectType="Permanent" /> </rule>...

Drupal 7 rewrite is removing get parameters from query string

php,drupal,drupal-7,rewrite
I've recently upgraded a site to the latest release of Drupal 7. The site has a view that retrieves a url with query string parameters from the database and then uses the Drupal rewrite functionality to add a class to the link like so: <a class="purple-button pull-right" href="[field_database_link-url]" target="_blank">View</a> The...

htacces rewrite single file

.htaccess,file,rewrite
I want to rewrite a specific file on my website to another one by using htaccess: # General RewriteEngine On RewriteBase / Options All -Indexes Options +FollowSymLinks # Rewrite file RewriteRule ^/file.html$ /dir/file.html [L] This is the .htaccess code i'm using based on snippets i found on the internet. Somehow...

htaccess url rewrite with RegEx

regex,.htaccess,url,rewrite
I want to redirect some url, but got some problem with it. The urls like: /sample?back=my-account /sample?back=history /sample?back=addresses And need to redirect to /sample My last try was this (but didn't work): RewriteCond %{QUERY_STRING} ^?back=history$ RewriteRule ^sample$ /sample [R=301,L] ...

htaccess rewriteRule in localhost

.htaccess,mod-rewrite,rewrite
I have a project in taha directory of my localhost, the client side part is in FrontEnd directory , now: How can I rewrite localhost/taha/FrontEnd to localhost in .htaccess?...

nginx rewrite for subsubdomains to subdomains

nginx,rewrite
We have an application where we use subdomains for each of our customer's installations. so we have customer1.ourapp.com, customer2.ourapp.com, customer3.ourapp.com and so on. Because of security we want to redirect all http to https, since we have a wildcard SSL certificate. Also, some customers are not that tech savvy and...

nginx redirect old URL to new URL

redirect,nginx,rewrite,url-redirection
We just updated all our product url to new url. It only add some letter in the URL. An example old URL: http://www.example.com/parent/children/product.html new URL: http://www.example.com/new-parent/children/product.html (just added "new-" in "parent") I try with this but not work. location /parent { rewrite ^/parent(.*) http://$server_name/new-parent$1 permanent; } So anyone can help...

Grouping file extensions for re-writing URL's [.htaccess]

.htaccess,mod-rewrite,url-rewriting,rewrite,file-extension
How can I group these two together; is it like ".(html|php)$" - please provide the code. Note, the answer should work for all file extensions: what is your thoughts on removing every file extension; comment on the code used - as it is rare to find. RewriteCond %{THE_REQUEST} ^GET\ (.*)\.html\...

Silverstripe hash link rewriting putting unwanted slash in link

hash,hyperlink,rewrite,anchor,silverstripe
Ok so I am developing a site in Silverstripe CMS that is using anchor links on one of it's pages. Thing is that in Silverstripe there is a rewrite going on that puts slashes before the hash in your links. So in the docs it explains that you can put...