mod-rewrite

.htaccess - won't add www to only one subdirectory

一曲冷凌霜 提交于 2020-02-25 07:34:46
问题 I have a .htaccess in root directory, with this content: <IfModule mod_rewrite.c> RewriteEngine on #RewriteCond %{HTTP_HOST} ^domain.com #RewriteRule (.*) http://www.domain.com$1 [R=301,L] </IfModule> If I go to http://domain.com/subdir it rewrites to http://www.domain.com/subdir. But I have a problem with one subdirectory named "crm" - if I go to http://domain.com/crm it redirects me to http://www.domain.com instead of http://www.domain.com/crm. In this "crm" subdirectory I have another

TYPO3 breaks urls without WWW

末鹿安然 提交于 2020-02-25 05:58:04
问题 The problem is that when I want to access my website like www.example.com/my/subpage all works great but when I try to access my website like this (without WWW) example.com/my/subpage TYPO3 breaks it down and redirect it to www.example.com/index.php/subpage . The redirect from non WWW to WWW is correct but why does it destroy my url? Here is the .htaccess redirect: RewriteCond %{HTTP_HOST} !^www\.example\.com$ RewriteRule ^(.*)$ http://www.example.com/$1 [L,R=301] For the "nice" urls I use

htaccess rewrite rule, old URL to new

此生再无相见时 提交于 2020-02-23 08:39:08
问题 A bit of help fellow SO people. What I have at the moment (based on some code I used for a different type of URL). I want the first URL to redirect to the second, with no query string included afterwards This is what I have to so far. RewriteRule ^(page.php?id=missionstatement+)/?$ http://example.com/why/mission-statement [R=301,L] RewriteRule ^(page.php?id=ofsted+)/?$ http://example.com/how/ofsted-report [R=301,L] RewriteRule ^(page.php?id=governingbody+)/?$ http://example.com/governors [R

RewriteCond REQUEST_URI - ^ doesn't work as expected

自古美人都是妖i 提交于 2020-02-19 07:02:58
问题 I'm building a site in codeigniter. I have a series of rewrite conditions & rules in the .htaccess file. The first set of rules turns SSL on or off depending on the first segment of the uri. Then it loops through again & if it finds a match, redirects the page appropriately. If there is no match, and the uri does NOT start with any of the strings listed, it redirects you to another page. If no conditions are met, it goes to the index page. The problem is with my first set of rules that turn

RewriteCond REQUEST_URI - ^ doesn't work as expected

天大地大妈咪最大 提交于 2020-02-19 07:01:30
问题 I'm building a site in codeigniter. I have a series of rewrite conditions & rules in the .htaccess file. The first set of rules turns SSL on or off depending on the first segment of the uri. Then it loops through again & if it finds a match, redirects the page appropriately. If there is no match, and the uri does NOT start with any of the strings listed, it redirects you to another page. If no conditions are met, it goes to the index page. The problem is with my first set of rules that turn

RewriteCond REQUEST_URI - ^ doesn't work as expected

女生的网名这么多〃 提交于 2020-02-19 06:59:13
问题 I'm building a site in codeigniter. I have a series of rewrite conditions & rules in the .htaccess file. The first set of rules turns SSL on or off depending on the first segment of the uri. Then it loops through again & if it finds a match, redirects the page appropriately. If there is no match, and the uri does NOT start with any of the strings listed, it redirects you to another page. If no conditions are met, it goes to the index page. The problem is with my first set of rules that turn

Why does leading slash not match my RewriteRule?

半世苍凉 提交于 2020-02-16 05:27:09
问题 I hope I'm missing something silly. I'm trying to redirect URLs using .htaccess on Apache 2.2 using the PHP 5.4 cartridge on OpenShift's free hosting service. This matches the URI /permalink/a123 (note the lack of leading slash in the rule's filter pattern): RewriteEngine On RewriteRule permalink/a.*$ /permalink/b [R=301,L] This does not match the URI /permalink/a123 (note the leading slash in the rule's filter pattern): RewriteEngine On RewriteRule /permalink/a.*$ /permalink/b [R=301,L] So

Why does leading slash not match my RewriteRule?

人盡茶涼 提交于 2020-02-16 05:26:12
问题 I hope I'm missing something silly. I'm trying to redirect URLs using .htaccess on Apache 2.2 using the PHP 5.4 cartridge on OpenShift's free hosting service. This matches the URI /permalink/a123 (note the lack of leading slash in the rule's filter pattern): RewriteEngine On RewriteRule permalink/a.*$ /permalink/b [R=301,L] This does not match the URI /permalink/a123 (note the leading slash in the rule's filter pattern): RewriteEngine On RewriteRule /permalink/a.*$ /permalink/b [R=301,L] So

.htacces url rewriting

萝らか妹 提交于 2020-02-08 06:44:06
问题 I have a php/apache website under my userdir, say http://localhost/~johnny5/ I have a /en folder with a .htaccess file and a index.php file : /home/johnny5/public_html /somefile.php /someotherfile.php /en/ .htacces index.php I enable url rewriting under /en so all the request are handled by index.php. here's the content of .htacces : Options +FollowSymLinks RewriteEngine On RewriteBase /~johnny5/en RewriteRule . index.php Up to here, everything works correctly. When I hit, say, http:/

htaccess rewrite rule to add another parameter to url query string or use php to handle?

孤者浪人 提交于 2020-02-08 01:30:12
问题 My question is, How do I redirect my old query string urls to the new query string urls. Examples below: I have updated my query string in url like so computerhelpwanted.com/jobs/?position=Oracle+Developer to the following computerhelpwanted.com/jobs/?occupation=Developer&position=Oracle+Developer Sometimes the query string structure is like this with a - separating the words. computerhelpwanted.com/jobs/?position=data-analyst and on rare instances it is like this computerhelpwanted.com/jobs/