Results 1 to 9 of 9
Thread: .htaccess rewrite help required
-
05-11-2014, 03:30 PM #1Newbie
- Join Date
- May 2013
- Posts
- 14
.htaccess rewrite help required
hi,
i followed this tutorial to get a dynamic php site going, but i cannot figure out how i can make the dynamic urls static
i need a rewriterule that can change
http://www.mysite.com/?page=index
to something like
http://www.mysite.com/index
(afcource this is just an example url and not my site)
i know this is possible, but i do not understand why it does not work, and i also observed some stuff on google but i don't understand a bit from those
so please help if you can, and if possible also explain your .htaccess rewrite script
-
05-11-2014, 04:17 PM #2WHT Addict
- Join Date
- Aug 2010
- Location
- Brussels, Belgium
- Posts
- 162
Hi,
Try this:
Code:RewriteEngine on RewriteCond %{QUERY_STRING} ^page=(.*)$ RewriteRule ^$ http://www.mysite.com/%1? [L,R=301]
www.StreamAnalyst.com
* viewers statistics for your video streaming (live and on-demand)
* listeners statistics for your internet radio
* supporting Wowza, Amazon CloudFront, Icecast, SHOUTcast, Unreal and more
-
05-11-2014, 04:34 PM #3Junior Guru Wannabe
- Join Date
- Feb 2005
- Location
- Wales
- Posts
- 48
Also make sure mod_rewite is running, do this by putting <?php phpinfo(); ?> in to a test php file then open it and check the "Loaded Modules" secton
█ • Web Hosting Broker
█ • 100% Free web hosting advice from industry experts
█ • Web hosting advice
-
05-12-2014, 01:37 AM #4Junior Guru Wannabe
- Join Date
- May 2014
- Posts
- 31
Just to add more Jean-Luc answer
Add this:
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
To prevent the rewrite broke your file and folder path.Last edited by idnx; 05-12-2014 at 01:42 AM.
-
05-12-2014, 02:17 AM #5Newbie
- Join Date
- May 2013
- Posts
- 14
-
05-12-2014, 02:26 AM #6Newbie
- Join Date
- May 2013
- Posts
- 14
i spoke to soon, it appears not to work :O
strangely
http://demo.queztech.net/
works but with the above help
http://demo.queztech.net/index.html
does not
and i still dont know how it works :O
-
05-12-2014, 02:29 AM #7Junior Guru Wannabe
- Join Date
- May 2014
- Posts
- 31
That to prevent file or folder to be rewritten too by mod_rewrite.
if you have folder /img but you do not tell mod_rewrite to ignore folder or file, it will make your folder or file not accessible.
When you try to access:
mysite/img
mod_rewrite will give you:
mysite/?page=img
CMIIW
-
05-12-2014, 02:38 AM #8Junior Guru Wannabe
- Join Date
- May 2014
- Posts
- 31
-
05-20-2014, 05:09 AM #9Newbie
- Join Date
- Mar 2013
- Posts
- 17
try with the help of wordpress htaccess file.Most of the code don't work
Similar Threads
-
htaccess rewrite
By greatdedserver in forum Hosting Security and TechnologyReplies: 6Last Post: 10-29-2012, 02:32 AM -
.htaccess Rewrite
By web_hosting4u in forum Hosting Security and TechnologyReplies: 5Last Post: 09-09-2008, 03:52 AM -
help with htaccess rewrite
By kafloofen in forum Hosting Security and TechnologyReplies: 1Last Post: 01-17-2008, 12:54 PM -
htaccess rewrite
By HD Fanatic in forum Hosting Security and TechnologyReplies: 2Last Post: 03-14-2007, 11:31 AM -
rewrite using .htaccess
By aawebtools in forum Dedicated ServerReplies: 2Last Post: 05-22-2001, 08:40 AM