mod-rewrite

How to convert plus (+) sign to “=+” with htaccess?

北战南征 提交于 2019-12-13 15:51:49
问题 I want to convert every url which contains "+" to "=+" for example that url: http://www.bedavaemlaksitesi.com/mersinemlakrehberi210/index3.php?+ should be like this: http://www.bedavaemlaksitesi.com/mersinemlakrehberi210/index3.php?=+ tried that and few other lines but doesn't work so far, i'm guessing it causes a loop or something. RewriteRule ^([^/\.]+)+([^/\.]+)?$ $1=+$2 [R] 回答1: I'm just gonna give you a literal answer for that specific example. Not sure if that will actually help you:

How to remove parts of URL by rewrite in htaccess

点点圈 提交于 2019-12-13 15:48:15
问题 I tried to apply other answers found on StackOverflow, but nothing worked. I have old links in Google, which people are visiting, but the structure of my page has changed and if people call those links, the page will be displayed messed up. I have links like these: /PIXMA/Canon-PRINT-Inkjet/SELPHY-664425773 /PL/SQL-Timestamp/Dawsons-Integral-Calculator-903670995 /--/-HDPrime-Dictionary-E-K/두산동아-중학교-교과서2007개정-교육-과정-429617286 I want to keep only the last part behind the last slash, like these:

Htaccess Public Folder Rewrite Rule

为君一笑 提交于 2019-12-13 15:37:16
问题 I'm working on a little custom MVC project in PHP and am having some issues with the htaccess. Originally, my htaccess was routing all traffic to index.php in my root dir, and passing the remaining path as an argument. This was working perfectly with this code: RewriteEngine On RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^(.+)$ index.php?path=$1 [NC,L,QSA] The problem I'm having now is that I need to move the index.php file into a /public directory. I

Accessing environment variables set using mod_rewrite in PHP

只谈情不闲聊 提交于 2019-12-13 15:36:41
问题 I have this little .htaccess file: RewriteEngine on RewriteRule ^(.*)$ urlroute.php?q=$1 [E=myvariable:'withthisvalue',B,QSA] To direct all requests to my URL routing script. It works great and I can access the requested URL in urlroute.php as $_GET['q'] . I'm setting the environment variable myvariable using mod_rewrite I am able to access it in urlroute.php as $_SERVER['myvariable'] . I am not able to access it using $_ENV['myvariable'] which seems strange. Could someone please explain what

How to rewrite directive on apache for anchor cms

南笙酒味 提交于 2019-12-13 15:23:48
问题 I'm using a cms called anchor. http://anchorcms.com/docs/getting-started/configuration when I go to domain.com/posts I get a 404, when I go to domain.com/index.php/posts page is displayed correctly. this is my httpd.conf file <VirtualHost *:443> #ssl blah blah DocumentRoot /var/www/anchor/ ServerName domain.com ServerAlias domain.com <Directory /var/www/anchor/anchor/> AllowOverride All Options Includes MultiViews Require all granted </Directory> </VirtualHost> this is my .htaccess file

RewriteRule for image file requests only if a query string is present

拜拜、爱过 提交于 2019-12-13 15:23:41
问题 With my limited regular expression and mod_rewrite abilities, I'm attempting to rewrite certain image requests so I can alter the output with a php script. Here's what I have: RewriteRule ^(public|uploads)/([A-Za-z0-9/_-]+).(JPEG|JPG|GIF|PNG|jpeg|jpg|gif|png)$ public/images.php?%{QUERY_STRING}&src=$1/$2.$3 [L] # [ 1 ] [ 2 ] [ 3 ] This does work, but it's too greedy and doesn't require the query string, which is important - otherwise all images requests would be rewritten. I tried putting a ?

.HTACCESS Merging Two Rules

☆樱花仙子☆ 提交于 2019-12-13 14:54:06
问题 1. RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^(.+)$ Ena.php?open=$1 [L,QSA] RewriteCond %{QUERY_STRING} ^([^=]+)$ RewriteRule ^/?$ Ena.php?open=%1 [L,QSA] 2. RewriteCond %{REQUEST_FILENAME} -f [OR] RewriteCond %{REQUEST_FILENAME} -d RewriteRule ^ - [L] RewriteRule "^(\x41|\x4F|\x53|\x4C\x4A|\x4E\x4A|D\xC5\xBD|\xC5\xA0|\xC4\‌​x90|\xC4\x8C|\xC4\x8‌​6|\xC5\xBD|\x00-\xF4‌​8FBFBF|[A-Z])[^/]*$" "/? open=Encyclopedia&letter=$1&term=$0" [NE,L,QSA] I need

Wildcard subdomain and subfolders as parameters in .htaccess

人盡茶涼 提交于 2019-12-13 14:35:42
问题 I have a portal site http://www.mysite.com/ where customers sign up and they get their own subdomain version of the site to run my app. I've set up the wildcard subdomain DNS/VirtualHost etc and got it working. What I am trying to set up is my htaccess file to pass the wildcard subdomain as a parameter to the app, like this: http://wildcardsubdomain.mysite.com/ -> http://www.mysite.com/app/?dj=wildcardsubdomain http://wildcardsubdomain.mysite.com/?l=genres -> http://www.mysite.com/app/?dj

Friendly URL in MODX redirects to home page

空扰寡人 提交于 2019-12-13 11:27:32
问题 I'm trying to use the User-Friendly-URL feature of MODX Revolution v2.2.14-pl (sdk) to eliminate the .html extension from the URL. An already clean URL redirects to the home page rather than showing the correct page. Why does the first URL redirect to the home page? /modx_revolution/zwei/ shows 'Home' page /modx_revolution/zwei.html shows correct page I've read that until the MODX and Browser caches are emptied the changed pages can only be viewed with the Preview function, which gives the

How to use htaccess to redirect to www and https without having too many redirects error

≡放荡痞女 提交于 2019-12-13 10:25:10
问题 I'm really stuck, as this is not my area, but I can get the following to work to redirect to www version, but as soon as I add another redirect to https (just bought the ssl and want to use it!) I get the "too many redirects" error. This is what I have in my working .htaccess file: RewriteEngine On RewriteCond %{HTTP_HOST} ^talbotandbourne.co.uk RewriteRule (.*) http://www.talbotandbourne.co.uk/$1 [R=301,L] ErrorDocument 404 /404.html So how do I add a redirect to https as well? Many thanks