hi friends there is some problem i need to convert
http://localhost/joomla/index.php?option=com_myblog
to
http://localhost/joomla/blog through .htaccess
any help?
If I'm not mistaken, Joomla by default ships with an htaccess.txt file that contains all the necessary script to do that. You just need to rename the file to .htaccess and enable the "friendly url" option in your sites settings.
http://www.noupe.com/php/10-mod_rewrite-rules-you-should-know.html ........ .htaccess should be in com_myblog folder other wise url mapping will not work like in noupe post it says URLs are Always Relative. problem solved thanks for anybody response
Related
In my php web site, I need to display my urn in a specific manner
I need to hide the query string parameters and just want to display the value in the URL
i.e.
mydomain.com/city.php?place='usa'&id=2
I need to display
my domain.com/city-2/usa
Is it possible?
Please help me. I am in a serious situation.
Thanks in advance
Yes, it is possible:
RewriteEngine On
RewriteBase /
RewriteRule ^city-(\d+)/(.*) city.php?place=$2&id=$1
You need to put it into the .htaccess placed in the web root of your site. To get it worked you need to have .htaccess parsing enabled and mod_rewrite apache module (assuming you have apache as a web server) enabled as well.
More in official documentation
I'm wanting to upload a standard php file to the root of my website which also has WordPress installed. I think there is something with the .htaccess file that's not letting me access a file even if it exists but instead passing every call through to WordPress's index.php file which in turn throws me to a WordPress 'page can't be found'.
I've looked through similar questions on here with no avail.
What I'm thinking is there is something funky going on, or I need to modify my .htaccess from the standard one that ships with WordPress or ??
Any help is appreciated!!
Thanks in advance,
Mark
If your file is called foo.php, add this line to your .htaccess file, directly below RewriteEngine on:
RewriteRule ^foo.php$ - [L]
Add a RewriteCond with the name of the file you want to access, that checks if the current file is the file that you want to access.
i am getting url is http://localhost:8888/qmc/public/index.php/get-quote
but i want to http://localhost:8888/get-quote..
using zend..
You should configure your virtualhost and .htaccess file.
Read this post for details.
Please how can I rewrite
Could anybody please rewrite this url?
http://localhost/display_news_cat.php?news_cat_id=14&p=2
to
http://localhost/display_news_cat/14/2
Thank you
Create an .htaccess file in the site directory and add the following lines
RewriteEngine on
RewriteRule ^display_news_cat/([\d]+)/([\d]+)$ display_news_cat.php?news_cat=$1&p=$2
Afaik, this is normally accomplished with Apache .htaccess file rewrite rules.
Is you case this would look something like:
RewriteEngine on
RewriteRule ^display_news_cat/([0-9]+)/([0-9]+)$ display_news_cat.php?news_cat_id=$1&p=$2
If this doesn't work, try checking your access logs to see what's happening.
there are different ways to archive this, and it takes only 1 minute to find this out yourself using google. you could:
use an .htacces file with rewrite-rules to let the apache do the rewriting
map everything on localhost/ to an index.php, read and parse the request-string "by hand" hand show the correct site
Also you can hold it in one script use GET to retrieve the values you wish and re-create the URL with that values. I don't know if it will help you..
Anyway a .httacess file will be much more useful for you.
I am building a site that will (obvisouly) have a front end public portion that I want to drive with Concrete5, but then it will also have a members section that I would like to build with Code Igniter.
Does anyone have any idea how I could do that?
I guess I could just throw the Code Igniter code into a sub directory, but would I run into any issues with that?
i can't see why not.
As you suggested a separate folder on the site would be one solution.
(you might have to tweak the .htaccess file (if you are using one) to ignore the other cms/framework
Another solution would be to have separate subdomains,
eg example.com and members.example.com
The answer, since the OP hasn't posted it, is to change the .htaccess rule:
RewriteBase /
to:
RewriteBase /foo/
where foo is your subdirectory that the index.php and CI reside. This .htaccess should also be in the same folder as the CI index.php. Works like a charm. Also don't forget to add the subdirectory to the base_url config setting.
I ended up using a sub directory for Code Igniter. I had to change the .htaccess file and Mod_Rewrite rules for apache in order for the Code Igniter "pretty" URLs to work correctly.
I will post the code later if I remember.