Viewed   82 times

I wanna turn PHP dynamic URLs into static URLs. For example, I want URLs like to become

and to become

When it's done, will my form validation on the site change?

My URL rewriting needs might not be much too complicated.

I'm developing it locally using XAMPP, Apache and MySql. Later I'll put it online.

How do I do that? Is this kind of URL rewriting technique the most adviced for SEO?



Yep. U need to use mod_rewrite. Also do a search for .ht_access files. You can put your rewrite directives in .ht_access files and drop them in to whatever directory on your server where you want them to take effect.

For the type of rewrite you want this rule generator should be of use to you:

And yes the URL you're trying to achieve is seo friendly.

Tuesday, October 11, 2022

Create .htaccess file in your web root and enter following there:

Options +FollowSymLinks
RewriteEngine on

RewriteRule ^product/([0-9]+)$ product.php?id=$1
Friday, September 16, 2022

If your server is Apache: Create on root folder file ".htaccess"

RewriteEngine On
Options +FollowSymlinks
RewriteRule /register index.php?mode=register


Monday, November 28, 2022

Enable mod_rewrite and .htaccess through httpd.conf and then put this code in your .htaccess under DOCUMENT_ROOT directory:

Options +FollowSymLinks -MultiViews
# Turn mod_rewrite on
RewriteEngine On
RewriteBase /

RewriteRule ^portfolio/(.*)$ /$1 [L,R=301,NC]
Sunday, October 23, 2022

in htaccess file insert this code :

RewriteEngine On
RewriteRule ^admin/([^/]*)/([^/]*)$ /admin/index.php?View=$1&Model=$2 [L]

The rewritten URL:

this site very useful for generate rewrite URL

Sunday, August 21, 2022
Only authorized users can answer the search term. Please sign in first, or register a free account.
Not the answer you're looking for? Browse other questions tagged :