Hi guys,
I've been struggling with a redirect where the final URL includes a query parameter that is an URL. It seems htaccess is escaping some characters.
Here is my htaccess:
Code:
RewriteRule ^mypath http s://www.otherserver.com/cookie?param1=123&redirectto=http://otherserver2.com/&param2=1 [L,R=302]
First, if I put
Code:
h...
So I'm stuck. I'm not very good with mod_rewrite or regular expressions in general, and this is giving me problems.
I need to redirect url's like
domain.com/view/Some_Article_Name.html
to
domain.com/index.php?p=view&id=Some_Article_Name
The rule that I have now works fine, but it also rewrites for all my stylesheets and images and st...
Hi All,
Our Linux server with Apache 2.x, Plesk 8.x hosts a number of e-commerce websites. To take advantage of browser caching we would like to use Google's provided copy of jquery.js.
Hence in the vhost.conf file of each we can use the following RewriteRule
RewriteCond %{REQUEST_FILENAME} jquery.min.js [nc]
RewriteRule . http://ajax...
We currently have domain.com/username redirected to domain.com/setsession.asp?u=username which then redirects to the app at domain.com/theapp.
This means users always see domain.com/theapp, so browsing to a page shows domain.com/theapp/somepage.asp
Looking to move this to subdomains ie
username.domain.com
(we'll get the host name a...
Is it better to have a single RewriteRule with a bunch of RegEx or multiples Rules with fewer RegEx for the server to query? Will there be any performance differences?
Heres is an example a single rule with almost all RegEx groups as optional:
RewriteRule ^gallery/?([\w]+)?/?([\w]+)?/?([\d]+)?/?([\w]+)/?$ /gallery.php?$1=$2&start=$3&b...
Recently, I want to restructure and redesign my website, my old website located at www.example.com, there are lots of blog posts under this domain, like:
www.example.com/post1
www.example.com/post2
www.example.com/post3
...
I can redirect all those posts to another sub domain points in another folder (not sub folder), (if I put all th...
Hi
I have enabled mod_rewrite in my Xampp apache. When I run my php info page, I saw mod_rewrite under Loaded Modules. So I think it's enabled.
Then I create a folder clean-url under htdocs. Inside clean-url folder I have 3 files
1) index.php here I put
Welcome
2) Test. php
3) .htaccess
Here I put
RewriteEngine On
RewriteRule ^(...
Hi -
I have a situation where I want to take the following URL:
/1/john
and have it redirect using Apache's htaccess file to go to
/page.php?id=1&name=john#john
so that it goes to an html anchor with the name of john.
I've found a lot of reference to escaping special characters, and to adding the [NE] flag so that the redirect ign...
this is my controller in CI
class Welcome extends Controller {
function Welcome()
{
parent::Controller();
}
function index()
{
}
function bil($model='')
{ }
I want to do a rewrite so that
http://example.com/index.php/welcome/bil/model
becomes
http://example.com/model
in my htaccess I have
RewriteBase /
Rewrite...
Hello,
I want to use mod_rewrite to hide the URL, that generates my XML file.
So if this is the requested URL:
http://www.domain.com/path/to/ page ? cid=8001&srt=po
This URL should be executed:
http:// www.xmldomain.com/bla/page ? cid=8001&srt=po &rtype=xslt&xsl=http://www.domain.com/path/to/ page .xsl
http://...
I want to convert .php extension to .html extension using .htaccess rules
Is this something I can do, and if so, how?
...
I have a script myscript.inc.php which handles all urls that look like /script-blah
I accomplish this by using following .htaccess
RewriteEngine On
RewriteRule ^script-(.*)$ myscript.inc.php?s=$1 [QSA,L]
However users could also access it this way by typing /myscript.inc.php?s=blah
I would like to prevent that. I tried
<Files ~ "\.i...
Hello. I have a edit page that looks at record_id's in the url.. I don't want the user to see any record id, that way they can't replace it with another and edit another record....
Anyways, my url is like:
http://www.mywebsite.com/folder/folder_detail_edit.php?recordID=3980
I would like it to just display:
http://www.mywebsite.com/f...
hey guys,
i wonder how i can solve the following problem.
on the root directory of my server lies a file calles upload.php
i want to be able to add a "/upload" (without .php) to my URL and the browser should ask for a password (and maybe username if possible). I i enter the password (and username) correctly upload.php should be opened. ...
Hi,
This is a follow-up of this question: Rewrite URL - how to get the hostname and the path?
I got this Rewrite Rule:
RewriteEngine On
RewriteRule ^(http://[-A-Za-z0-9+&@#/%=~_|!:,.;]*)/([-A-Za-z0-9+&@#/%=~_|!:,.;]*)\?([A-Za-z0-9+&@#/%=~_|!:,.;]*)$ http://http://www.xmldomain.com/bla/$2?$3&rtype=xslt&xsl=$1/$2.xsl...
At this time every site on my server is on the domain "mydomain.com" or "subdomain.mydomain.com", I do various re-writes depending on the subdomain used to access the site.
What I want to do now, is send any request NOT from my domain or subdomains to a script for handling...... sounds simple, but I can't get it working..
This is what ...
force https
RewriteCond %{HTTPS} =off [NC]
RewriteCond %{REQUEST_URI} ^/?(bingo/account|bank)(.*)$
RewriteRule ^.*$ https://%{HTTP_HOST}/%1 [R=301,L]
RewriteCond %{HTTPS} =on [NC]
RewriteCond %{REQUEST_URI} !^/?(bingo/account|bank).*$
RewriteRule ^.*$ http://%{HTTP_HOST}%{REQUEST_URI} [R=301,L]
it's a nightmare, when i go to /bank i...
I want all css, javascript, and image file requests, that are named like this "filename.12345.css" to be re-routed to "filename.css".
The ".12345" part will always be numbers and the length can be anywhere from 11 - 15 characters.
This directive seems to work OK but I want to make sure there is no error in my logic.
RewriteRule ^(.+...
I want a user to be able to load a url in their browser, but not get redirected:
http://example.com/abc/{var1}/{var2}/def
I want the example.com apache 2.2 server to take that request, and "invisibly" and without redirect reverse proxy it to:
http://other.example.com/abc/{var1}/{var2}/def
I have spent hours trying different combina...
hello....
my current url is
categories_name.php?cname=at&t
rewritten url like this.
carriers/at&t
this is htaccess url.
RewriteRule ^carriers/(.*)$ categories_name.php?cname=$1 [L]
above url is working for all like
categories_name.php?cname=all-tel
when variable(at&t) has '&' symbol then problem occuring. so how to write hta...