I have a few urls set up like this within eg http://www.mydomain.com/user_text.php?name=Funny does anybody know what to put in the htaccess file so that it'll make the urls like: http://www.mydomain.com/Funny or http://www.mydomain.com/funny.html http://www.mydomain.com/funny.htm http://www.mydomain.com/funny.shtml any one
For : http://www.mydomain.com/Funny RewriteRule ^(.*) /user_text.php?name=$1 For :http://www.mydomain.com/funny.html RewriteRule ^(.*).html /user_text.php?name=$1 [NC] etc...
have a few urls set up like this within eg http://www.mydomain.com/user_sms.php?id=45 does anybody know what to put in the htaccess file so that it'll make the urls like: http://www.mydomain.com/45 or http://www.mydomain.com/45.html http://www.mydomain.com/45.htm http://www.mydomain.com/45.shtml any one help me plz
If your .htaccess is blank, add this: RewriteEngine On RewriteBase / RewriteRule ^(.+).html user_text.php?name=$1 [L,NC,R=301] Or, if it already has the first two lines, just add the third line.
# -FrontPage- IndexIgnore .htaccess */.??* *~ *# */HEADER* */README* */_vti* <Files gallery> ForceType application/x-httpd-php </Files> <Limit GET POST> order deny,allow deny from all allow from all </Limit> <Limit PUT DELETE> order deny,allow deny from all </Limit> AuthName www.efreesms.com AuthUserFile /home/efreesms/public_html/_vti_pvt/service.pwd AuthGroupFile /home/efreesms/public_html/_vti_pvt/service.grp RewriteEngine On RewriteBase / RewriteRule ^(.+).html user_sms.php?id=$1 [L,NC,R=301] still not done visit http://www.efreesms.com
What is your requirement , Redirect or Rewrite? Don't put [R=301] if you need rewrite... this is the correct way, RewriteRule ^(.*).html /user_sms.php?name=$1 [NC] I have tested above thing in my web server... It worked , I use .htaccess. It is easy because we don't need to restart apache each time we do changes.