Tuesday, September 14, 2010

make url seo friendly in ur website preg_replace for url Rewriting

preg_replace for url Rewriting...
Hi,

I have written a way to shorten urls on my database driven web site.
I have everything working, except for the part that converts dynamic url into user friendly ones.
That function works perfectly for urls such as /test.php?variable=true&otherVariable=false, but on occasion it has to face a url such as /test.php?var= , which it can't handle.

This has been fine, as, at worst, the user sees a page with a .php extension, but now i have changed the way my url rewriting works and giving the page a .php extension causes it to die with a bunch of error messages.

Hopefully you can help me modify this function so when faced with a url such as /mysite/test.php?thisVar= (with no value), it will just trim the empty variable from the name and then translate the url.


here is the function i currently use:






5 comments:

  1. I am glad to read this blog and It will be explain nicely and It is something different compare too.Each information are good and well written.Thanks for making this post.
    Joomla developer

    ReplyDelete
  2. Very Nice information on SMO services Delhi and keep share it more.

    ReplyDelete
  3. Best Digital Marketing & SEO Services Company in Faridabad, India - DigitalHoper Technologies is the Best Digital Marketing Company in India Based in Faridabad. DigitalHoper Technologies Faridabad is an India based the most trustworthy SEO Company in Faridabad, DigitalHoper Technologies Faridabad offering Internet Marketing, Digital Marketing, Online Marketing, Web Marketing, Growth Marketing, SEO, SMO, SEM, ORM, SMM, PPC, Lead Generation, Website Designing and Website Development solutions for small to large business. DigitalHoper Technologies Faridabad is a Best SEO services agency, Digital Marketing Firms and also a top website designing and development services provider company. DigitalHoper Technologies Faridabad ranks among the top SEO companies in India, Gurgaon, Noida, Ghaziabad, Delhi and all over India.

    DigitalHoper Technologies Faridabad Offers Website Development, Website Designing, On-page SEO, Off-page SEO, Backlink Building, Conversion Rate Optimization, Brand Reputation Management, Online Reputation Management, Content Development, SEO, PPC, Internet Marketing Solutions.

    Call us to get expert top-level digital marketing services from the best digital marketing agency in Faridabad India. The best digital marketing company in Faridabad providing expert digital marketing services in Faridabad, Haryana.

    Get access to one of the best digital marketing consultants in Faridabad & Delhi NCR to provide up-to-date and complete digital marketing services in India to rank better for your business keyword on Google Search Engine.

    DigitalHoper Technologies Faridabad works in the Advertising, Branding & Marketing industry, specialising in Search Engine Marketing, Online Marketing, Digital Marketing, Online Branding, Google Adwords, Search Engine Optimization, Project Management, Social media management, Web Analytics, Website Development and Website Designing.

    DigitalHoper Technologies Faridabad is a professional digital marketing & website designing agency in India that offers web design, web development and SEO services, PR, Exhibitions, events, social media marketing, email marketing, mobile marketing, brand management, and internet marketing services in New Delhi India. We count in the Top 5 Digital marketing companies in India Delhi NCR Noida Faridabad. Also, we are the best digital marketing service providers communications advertising agencies and comes in the best Digital marketing companies in India with branches in Faridabad, Delhi and Noida.

    For more information visit here:

    Visit: https://www.digitalhoper.com/

    ReplyDelete
  4. Making URLs SEO-friendly is crucial for better search engine rankings. Using preg_replace for URL rewriting can streamline this process. For expert SEO strategies, consult top professionals in SEO Singapore.
    Read more: seo singapore

    ReplyDelete

thanks to Comment Form this i will be reply soon...