Quantcast
Channel: Tricky .htaccess settings
Viewing all articles
Browse latest Browse all 10

Tricky .htaccess settings

$
0
0

@raseone wrote:

Something like this works.

PRETTY URLS FOR DYNAMIC PAGES

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^item=([a-zA-Z0-9]+)$ item.php?itemname=$1 [L]
RewriteRule ^free_item=([a-zA-Z0-9]+)$ free_item.php?itemname=$1 [L]

PRETTY URL FOR STATIC FILES

RewriteRule ^([a-zA-Z0-9]+)$ $1.php [L]

I’ can now use URLs like https://example.com/item=itemname

If I do something like this then I can have “pretty URLs” for any number of static pages or dynamic pages with specific or non-specific parameters etc…

Since the actual file names can be obfuscated here & the file extensions are gone I can skip the rules that strip unwanted query strings.

Read full topic


Viewing all articles
Browse latest Browse all 10

Trending Articles