mod-rewrite

Apache mod_rewrite converts double slashes to one slash

依然范特西╮ 提交于 2019-12-23 20:33:21
问题 i have a URL like this: http://example.com/img.php?url=http://example2.com/path/to/image/name.jpg so i created a rule by help of this question Apache mod_rewrite complex URL regex RewriteRule ^img.php\/(.+?(?:\.jpg|\.png))$ img.php?url=$1 but when i use this rule in htaccess file and use same URL like this: http://example.com/img.php/http://example2.com/path/to/image/name.jpg in result double slashes after http: in my parameter converts to one slash! so my first parameter in php becomes: http

.htaccess rewrite rule for email / token

坚强是说给别人听的谎言 提交于 2019-12-23 19:26:21
问题 I can't make this work, any ideas? .htaccess code: Options +FollowSymlinks Options -MultiViews RewriteEngine On RewriteRule ^unsubscribe/([^/]*)/(.*)/&$ unsubscribe.php?hash=$1&email=$2 I'm trying to transform this URL: unsubscribe.php?hash=dbacb2d010eb022619e90c8df2654aab273&email=enriquealbiola@iqs.edu To this one: unsubscribe/dbacb2d010eb022619e90c8df2654aab273/enriquealbiola@iqs.edu I've really tried searching, and the code I have is what I got, but it isn't working... Thanks! 回答1:

mod_rewrite mysterious subreq

蹲街弑〆低调 提交于 2019-12-23 19:23:25
问题 Seems like some apache module is interfering with my request uris as it suffixes ".html" to it. My rewrite log: 172.16.103.1 - - [08/Mar/2012:14:56:33 +0100] [www.example.org/sid#7ff723575b58][rid#7ff724b4fc58/initial] (1) pass through /folder/subfolder/ 172.16.103.1 - - [08/Mar/2012:14:56:33 +0100] [www.example.org/sid#7ff723575b58][rid#7ff724b42468/subreq] (3) [perdir /srv/www/html/project/] add path info postfix: /srv/www/html/project/folder/subfolder.html -> /srv/www/html/trustedshops

HTACCESS 404 error not working properly

醉酒当歌 提交于 2019-12-23 19:02:10
问题 The problem: The requested URL /welcome.php was not found on this server. Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request. Here it goes: When I go to www.mysite.com/page it works fine, it also works if I go to mysite.com/404 But, when I misspell something and go to www.mysite.com/pag (instead of 'page') I'll get the above error. I'm also using PHP in my index file (welcome.php) to determine the $_GET value and dynamically display

htaccess rewrite and auth conflict

跟風遠走 提交于 2019-12-23 18:04:19
问题 I have 2 directories each with a .htaccess file: html/.htaccess - There is a rewrite in this file to send almost everything to url.php RewriteCond %{REQUEST_URI} !(exported/?|\.(php|gif|jpe?g|png|css|js|pdf|doc|xml|ico))$ RewriteRule (.*)$ /url.php [L] and html/exported/.htaccess AuthType Basic AuthName "exported" AuthUserFile "/home/siteuser/.htpasswd" require valid-user If I remove html/exported/.htaccess the rewriting works fine and the exported directory can be access. If I remove html/

Point an <img> tag to a image dynamically generated by PHP?

落爺英雄遲暮 提交于 2019-12-23 17:21:36
问题 Is it possible to redirect an image to a dynamically generated image(using PHP)? I have a dynamically created image and it has an extension ".PHP" (obviously) and that server is not under my control. So I want to redirect "somename.jpg" (on my server) to "remoteserver/dynamicimage.php" (on some remote server not under my control) so that I can right away link it as <img src="somename.jpg"/> and the dynamically generated image is shown. Please let me know if this is possible. 回答1: Browsers

.htaccess rule, redirecting old unexistent address to new address

允我心安 提交于 2019-12-23 16:43:45
问题 Here is how are looking my old post adresses on a blog: subdomain.domain.com/view/1310/article-title/ I'd like it when a visitor comes from Google on such an address, to be redirected like so: http://www.domain.com/article-title/ I need to specify some details regarding the old/first link: subdomain , is a variable view , is a fixed word 1230 , cand be any number/id I tried this: Options +FollowSymLinks RewriteEngine On RewriteCond %{HTTP_HOST} subdomain.domain.com $ [NC] RewriteRule ^/view/(

RewriteRule is redirecting to an absolute path, rather than the proper URL

假如想象 提交于 2019-12-23 16:30:46
问题 I've created a bunch of RewriteRules for my website and have had no problem with them on my local setup. Here's a snippet from my .htaccess: Options +FollowSymLinks -MultiViews RewriteEngine On RewriteRule ^news/?$ news.php [L] Locally, when I visit 127.0.0.1/news, it redirects properly to news.php and masks the URL. I just updated the .htaccess file on the remote server and receive this error, when trying to visit the above example: The requested URL /mnt/target02/123456/123456/www.mywebsite

Need help with Apache Rewrite issues

放肆的年华 提交于 2019-12-23 16:25:33
问题 My developer has provided me some Apache rewrite rules that are required for our application to work. When I added them to Apache my www.domain.com/blog and www.domain.com/phpmyadmin pages no longer worked. I tried to add the first RewriteCond rule for my blog and also the final phpmyadmin rule but neither one is working as expected. Essentially I want any requests to /blog or /phpmyadmin to NOT rewrite and go to my document root directory and run those applications outside of rewrites. Can

301 Htaccess RewriteRule Query_String

冷暖自知 提交于 2019-12-23 16:23:55
问题 Problem: Visitors open the url website.com/?i=133r534|213213|12312312 but this url isn't valid anymore and they need to be forwarded to website.com/#Videos:133r534|213213|12312312 What I've tried: During the last hours I tried many mod_rewrite (.htaccess) rules with using Query_String, all failed. The last message in this topic shows a solution for this problem, but what would be the rule in my situation. I'm very curious how you would solve this problem :)! 回答1: The following will handle the