Reputation: 59
So I am using a script from the internet and i get the following URL generated:
http://mydomain.net/pages/92/Marketing-Idea
And I want it to look the following:
http://mydomain.net/marketing-idea
I'm noob with the URL rewriting, so after looking up for some tutorials I've tired the following rule / condition but it doesn't work at all:
RewriteRule ^/([A-Za-z0-9-]+)/?$ /pages/$1/$2 [NC,L] # pages
Any one that could help me? I'm desperate here and can't get this crap to work!!
This is the entire .htaccess file as it is:
#SetEnv APPLICATION_ENV development
Options -Indexes
Options +FollowSymLinks
DirectoryIndex index.php index.html
<ifModule mod_rewrite.c>
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)\?*$ index.php [L,QSA]
RewriteRule ^([0-9]+)/([a-z0-9-]+)/?$ /pages/$1/$2 [NC,L]
</ifModule>
<ifModule mod_expires.c>
ExpiresActive On
ExpiresDefault "access plus 1 seconds"
ExpiresByType text/html "access plus 1 seconds"
ExpiresByType image/gif "access plus 2592000 seconds"
ExpiresByType image/jpeg "access plus 2592000 seconds"
ExpiresByType image/png "access plus 2592000 seconds"
ExpiresByType text/css "access plus 604800 seconds"
ExpiresByType text/javascript "access plus 216000 seconds"
ExpiresByType application/x-javascript "access plus 216000 seconds"
</ifModule>
<ifModule mod_deflate.c>
<filesmatch "\.(js|css|html|jpg|png|gif|eot|woff|ttf|svg)$">
SetOutputFilter DEFLATE
</filesmatch>
</ifModule>
<FilesMatch "\.(htaccess|htpasswd|ini|log|sh|inc|bak|cache)$">
Order Allow,Deny
Deny from all
</FilesMatch>
Best Regards, Dorian
Upvotes: 0
Views: 130
Reputation: 785146
Try this rule in your DOCUMENT_ROOT/.htaccess
file:
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^([0-9]+)/([a-z0-9-]+)/?$ /pages/$1/$2 [NC,L]
Upvotes: 1