mod-rewrite

mod_rewrite on apache - language parameter

◇◆丶佛笑我妖孽 提交于 2021-01-28 13:35:03
问题 I have searched for a solution of this problem all over the Internet, read various threads and articles about it but did come to a full solution for my - i think quite generic problem in mod_rewrite. Here is the issue: I have developed a small webapp that lets users make calculations (splitting costs after holidays "who pays to whom"). Now I have come to the point where I want to make it (especially the static pages) language dependent. What seemed like no big deal by passing a get parameter

mod_rewrite on apache - language parameter

拥有回忆 提交于 2021-01-28 13:34:09
问题 I have searched for a solution of this problem all over the Internet, read various threads and articles about it but did come to a full solution for my - i think quite generic problem in mod_rewrite. Here is the issue: I have developed a small webapp that lets users make calculations (splitting costs after holidays "who pays to whom"). Now I have come to the point where I want to make it (especially the static pages) language dependent. What seemed like no big deal by passing a get parameter

mod_rewrite on apache - language parameter

≯℡__Kan透↙ 提交于 2021-01-28 13:33:21
问题 I have searched for a solution of this problem all over the Internet, read various threads and articles about it but did come to a full solution for my - i think quite generic problem in mod_rewrite. Here is the issue: I have developed a small webapp that lets users make calculations (splitting costs after holidays "who pays to whom"). Now I have come to the point where I want to make it (especially the static pages) language dependent. What seemed like no big deal by passing a get parameter

Why does mod_rewrite redirect to /index.php/index.php/index.php etc

人盡茶涼 提交于 2021-01-28 12:27:57
问题 I want every subdomain to act as a folder, so basicly: projects.dev -> / test.projects.dev -> /test amazing-project.projects.dev -> /amazing-project And I have this code in my Virtualhost file: <VirtualHost *:80> ServerName projects.dev DocumentRoot "D:/xampp/htdocs/projects" ServerAlias *.projects.dev RewriteEngine on RewriteCond %{HTTP_HOST} ^(.*)\.projects\.dev RewriteRule ^/(.*)$ "D:/xampp/htdocs/projects/%1/$1" [L,R=301] </VirtualHost> However when i go to "designs.projects.dev" it gets

htaccess RewriteCond REQUEST_URI detection not working

三世轮回 提交于 2021-01-28 12:11:11
问题 I have two different things I want to happen in the case of two different types of URI's but I can't seem to stop the second case from executing where the first case has already been accepted. Here's an example: abc.com abc.com/asdf abc.com/en/asdf abc.com/zh-cn/asdf/asdf Should all be directed to this RewriteRule: RewriteRule ^(([a-z]{2})(-[a-z]{2})?)(/([a-z0-9-\./]*))?$ /index.php?lng=$1&tpl=$4 [QSA,L,NC] Part 2: abc.com/myadmin/ abc.com/myadmin/asdf abc.com/myadmin/en/asdf abc.com/myadmin

How to rewrite URLs with .htaccess (removing id?=1)

有些话、适合烂在心里 提交于 2021-01-28 11:41:15
问题 I've looked all over and have yet to figure out how to make this work, I'm sure it's very simple for someone who knows what they're doing. For starters, I have made sure that mod_rewrite is enabled and removing .php extensions is working so I know that isn't the issue. Currently I'm working on a forum, and what I'm trying to do is simply remove the ?id=1 aspect of the URL, so basically making the URL look like such: http://url.com/Forum/Topic/1 Instead of http://url.com/Forum/Topic?id=1

Redirect subfolder request to Passenger

前提是你 提交于 2021-01-28 10:51:01
问题 I want to redirect all requests like mysite.com/subfolder/... to Django application over Passenger and all other requests to the website running under some php cms. File structure: .htaccess subfolder/ .htaccess some cms files Content of root .htaccess : RewriteEngine on ... RewriteConds and RewriteRules generated by php cms Content of subfolder/.htaccess : PassengerAppRoot "/home/username/djangoapplication" PassengerPython "/home/username/virtualenv/webapp/2.7/bin/python2.7" The problem is

Mod_rewrite - change .htaccess into httpd.conf file

房东的猫 提交于 2021-01-28 09:47:07
问题 I have following .htaccess rules which removing .php extension in urls from domain.com/index.php to domain.com/index/ and working fine Options +FollowSymLinks -MultiViews RewriteEngine On RewriteBase / RewriteCond %{THE_REQUEST} ^[A-Z]{3,}\s([^.]+)\.php [NC] RewriteCond %{REQUEST_METHOD} !POST RewriteRule ^ %1/ [R=301,L] RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME}.php -f RewriteRule ^(.*?)/?$ $1.php [NC,L] Now I want to use httpd.conf file instead of .htaccess, but

mod_rewrite: how to prioritize files over folders

青春壹個敷衍的年華 提交于 2021-01-28 07:05:15
问题 I have URLs like this: http://www.example.com/name1 http://www.example.com/name1/ http://www.example.com/name1/test1 and I have a file/folder structure that looks like this src | ----name1.html | ----name1 | ----test2.html 1) If a user visits e.g. http://www.example.com/name1 or http://www.example.com/name1/ (w/ trailing slash) I want to serve the html-file. 2) If a user visits e.g. http://www.example.com/name1/test1 I want to serve the html-file inside the folder test1 . The different

htaccess Rewrite Rules appending parameter?

巧了我就是萌 提交于 2021-01-28 07:05:04
问题 Our original urls began with a parameter and the following rewrite works to redirect them (thanks to Jon Lin). However, the original parameter is being appended to redirect, so that RewriteEngine On RewriteCond %{QUERY_STRING} ^old-page$ RewriteRule ^$ /newpage [R=301,L] ends up going to mydomain.com/newpage?old-page Any idea how to fix? thanks again, Geoff 回答1: Have it like this to strip off existing query string: RewriteEngine On RewriteCond %{QUERY_STRING} ^old-page$ [NC] RewriteRule ^$