If I use mod-rewrite to change a url like this:
http://www.mysite.com/page.php?title=my-name-is-john
to
http://www.mysite.com/page/my-name-is-john
and if the page.php file contains a script that relies on parameters passed through the url like:
$_GET['title'];
Then will that script still work after the mod-rewrite has been imple...
I am trying to do a 301 redirect of everything from an old subdomain to a new.
I have a simple .htaccess
Redirect 301 / http://www.smartphonesoft.com/
However if I goto the old URL with a subdir, it tries to redirect to the new domain with a subdir and fails.
ie
http://forum.smartphonesoft.com/reminder/
goes to
http://www.smar...
Hi, I would like to find a way for users to be able to type their username after my domain name to access their public profile page.
For example, if you type youtube.com/username it shows that user's channel page. The resulting page is the same as youtube.com/user/username.
So with my website, I have mydomain.example/users/profile.php?na...
I know there are a lot of questions on here about this, but most of them seem to be from people who don't know that 'memory_limit', 'post_max_size', and 'upload_max_filesize' are PHP_INI_PERDIR (i.e. they can't be changed using ini_set()). I already learned that the hard way.
However, everything indicates that I should be able to change...
Hello,
I am trying to re-write this:
http://www.domain.com/sample/comments/68
Into this:
http://www.domain.com/sample/comments/index.php?submissionid=68
Here is what the .htaccess file looks like in both the directory represented by "sample" above and the directory "comments":
RewriteEngine on
RewriteRule ^comments/([0-9]+)?$ ind...
Is it possible?
Let's say my directory structure looks like this:
/data
/data/images
/public
The document root is in the "public" directory. This won't work, of course:
<img src="/../data/images/1.png" alt="" />
But maybe it's possible to enable serving images from directory above document root somehow? I would like to know.
...
I am using a .htaccess file to direct requests for a directory to a custom php file that provides info about that directory (and i want the url displayed by the browser to not change).
Here is the relevant part of the .htaccess file.
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^(.*)$ /myphp.php?url=%{REQUEST_URI} [QSA,L]
This wor...
I'm sure this is probably really simple, but my knowledge really isn't good in this area, and I don't seem to be able to get it right.
I have the following file structure:
/cms (renamed from system)
cms.php (renamed from index.php, added to DirectoryIndex in .htaccess)
.htaccess
index.html
page1.html
/css
/js
I also have the .htacce...
hi, i have a website, lets say:
http://www.domain.com/
and im using rewrite module
but! i have a subfolder
forum.domain.com
and i dont want the htaccess to affect this directory, how to do it?
please, its real urgent
...
Hi,
I am using a CMS that hosts multiple websites simultaneously and I am seeking a method to properly serve sitemap.xml files for each site. I have concluded that a mod-rewrite rule will be the most effective solution for this.
My idea is to have a /sitemaps/ directory with the site map for each domain named as the domain name, i.e. /...
Hello,
I have a hyperlink that looks like this:
http://domain.com/sample/comments/65
And when I click on it, it goes to this:
http://domain.com/sample/comments/index.php?submissionid=65
I'm using a rewrite rule to make it do this. This is what I want, except I also want the URL displayed in the browser to still look like "http://...
So I have asked for help over at my weblog, scoured the internet, and pored over the examples you all have provided on here before, and I still cannot find an answer that works.
Simply put, I am trying to take all traffic referred to my site from Site A, and redirect it all to Page B within my domain. I have gotten the redirect to wo...
I have a directory that lists products by categories. if a _GET variable exists, it is used in a query. I would like to use "pretty url's", like: example/a/1/b/2/c/3/d/4 becomes example/index.html?a=1&b=2&c=3&d=4
most .htaccess examples I see only use variables to replace the _GET values, but I can use rules like this:
Options +Follow...
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^([a-zA-Z0-9_-]+)\.html$ product.php?pid=$1&rewrite=1&%{QUERY_STRING} [L,QSA,NC]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^([a-zA-Z0-9_-]+)\.html$ product2.php?cid=$1&rewrite=1&%{QUERY_STRING} [L,QSA,NC]
R...
I have a site which redirects all requests for files/folders which don't exist to an index file using .htaccess:
RewriteCond %{REQUEST_FILENAME} -s [OR]
RewriteCond %{REQUEST_FILENAME} -l [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^.*$ - [NC,L]
RewriteRule !admin/* index.php [NC,L]
There is a folder "admin/" which has the f...
I'm running PHP on a shared Apache web server. I can edit the .htaccess file.
I'm trying to simulate a file file structure that is not actually there. For example, I would like for the URL: www.Stackoverflow.com/jimwiggly to actually display www.StackOverflow.com/index.php?name=jimwiggly I got halfway there by editing my .htaccess fi...
I have a vague idea on how to solve this, but really need a push :)
I have a Django app running with apache (mod_wsgi). Today urls look like this:
http://site.com/category/A/product/B/
What I would like to do is this:
http://A.site.com/product/B
This means that the url dispatcher some how needs to pick up the value found in the subdo...
Hi
I have to upload a pdf file with 34MB. My site is in Linux with php. But my site support only 8MB. (I know this from phpinfo). How I increase the size? I heared that we can change it in php.ini through. htaccess. But where I get php.ini? How I change the size?. Does any one give me a solution ?
...
I was coding few php pages to display customer quotations, on rep.php, user can click view details button (POST quoteID as the variable to quotedetails.php?quoteID=Q123456) to view the detailed info about a particular quote.
Then I use .htaccess to make all php pages to html extention and rewrited url from 'quotedetails.php?quoteID=Q12...
Hello
Using following
Options +FollowSymlinks
RewriteEngine on
RewriteCond %{REQUEST_URI} !/temp_page.php$
RewriteCond %{REQUEST_URI} !/thanks.php$
RewriteCond %{REMOTE_HOST} !^90\.333\.222\.111
#RewriteCond %{REMOTE_HOST} !^127\.0\.0\.1
RewriteRule $ /temp_page.php [R=302,L]
can allow myself (ip) to view all pages, and other get...