Tag Archives: url

Url hide using codeigniter

Questions: I am using codeigniter… I want a clean URL from below URL http://localhost:8080/rtvnews/index.php/home/videonews?id=67598/newstitle here home => controller, videonews => function and ?id=6586565 is a url string. I want to remove /index.php/home/videonews?id=67598 and replace with /news/ Below Final url I need to get http://localhost:8080/rtvnews/news/newstitle Answers:

Sending additional variable to server with dataUrl

Questions: This should be a simple fix, but I just have not been able to find anything about it. I am using both postData and editData to POST a variable to the server for form editing. This variable is used in a switch to select the appropriate function. This php contains ALL of the functions… Read More »

Custom urls – giving each user a url

Questions: I am building a website and I would like to customize the users’ profile so their profile url shares their name. For example, the website domain would be www.example.com and the users’ url would be www.example.com/username. I am assuming this is a convention because I see this all around the web. Is this done… Read More »

Customize Url or Hide Query String using .htaccess

Questions: I am new one, I learn .htaccess. I want to customize my URL from index.php?page=mobile to index/page/mobile I used this code but it doesn’t work: RewriteEngine on RewriteRule ^index/([0-9]+)/?$ index.php?page=$1 [NC,L] # Handle product requests and RewriteEngine on RewriteRule ^index/([^/.]+)/?$ index.php?page=$1 [L] Answers:

URL rewriting in PHP when several values are being passed in the URL

Questions: I am currently researching how to modify URLs in php using Mod rewrite. A typical URL could look like this: http://www.fitness.com/find_a_pt/?county=&constituency=211&gender=&action=search Now in the above example only a constituency has been selected. No county or gender has been specified. Now the above constituency refers to ‘Dartford’. So it would be good if the URL… Read More »

How to scrape a SSL or HTTPS URL

Questions: I have written a function to scrape a website using CURL but it returns nothing when called and can’t understand why. The output is empty <?php function scrape($url) { $headers = Array( “Accept: text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5”, “Cache-Control: max-age=0”, “Connection: keep-alive”, “Keep-Alive: 300”, “Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7”, “Accept-Language: en-us,en;q=0.5”, “Pragma: ” ); $config = Array( CURLOPT_RETURNTRANSFER => TRUE ,… Read More »

Amazon MarketplaceWebServiceOrders requests suddenly failing, PHP curl giving SSL CA cert error?

Questions: Starting at 4am Sunday, we suddenly started seeing errors from curl, from the Marketplace Web Service Orders PHP5 Library MarketplaceWebServiceOrders/Client.php script: Caught Exception: Internal Error Response Status Code: 0 Error Code: Error Type: Request ID: XML: ResponseHeaderMetadata: RequestId: , ResponseContext: , Timestamp: The actual curl error number is 77, with the message being: Problem… Read More »

remove trailing slash from URL in htaccess

Questions: I have my htaccess configured to work in conjunction with a URL Router I’ve written in PHP. I’m trying to remove a trailing slash if seen from the URL except the root url. My htaccess file looks like this: Options -MultiViews RewriteEngine on RewriteBase / RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^(.+)$ index.php?uri=$1… Read More »

Rewriting a URL to a PHP parameter from inside a subdirectory

Questions: What I’m asking for is simply rewriting any URL-given sub-directiories to a PHP URL parameter for nicer looking, user friendly URL. I know that this is possible using the Apache Rewrite Engine and associated parameters. The problem on my end is that I do not want to rewrite i.e mydomain.com/parameter ———–> mydomain.com/index.php?id=parameter But rewriting… Read More »