I use Godaddy Apache server to build my own blog, and I did some search of SEO friendly url tutorials, and applied the following code in my web root .htaccess file to transfer links like http://www.bgmemo.com/blog.php?url=2012/08/23/4-steps-to-initialize-Apache-Derby-10-9-1-0-in-Netbeans-7-1-1.html to http://www.bgmemo.com/blog/2012/08/23/4-steps-to-initialize-Apache-Derby-10-9-1-0-in-Netbeans-7-1-1.html :
RewriteEngine on
RewriteRule ^([a-zA-Z0-9-/]+).html$ blog.php?url=$1
RewriteRule ^([a-zA-Z0-9-/]+).html/$ blog.php?url=$1
But it does not work. The htaccess is working and other code in it is applied. Who can tell me what is wrong? Thanks in advance.
Try this:
RewriteEngine on
RewriteBase /
RewriteRule ^blog/([a-zA-Z0-9\-/\.]+)/?$ blog.php?url=$1 [L]
This is the correctly way for donĀ“t have problems with your .htaccess
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteBase /
RewriteRule ^blog/([a-zA-Z0-9\-/\.]+)/?$ blog.php?url=$1 [L]
</IfModule>
Related
I want to rewrite the url of mysite with help of htaccess. My website url which I need to rewrite is given below.
http://getallfreedownloads.com/category.php?slug=business_directory_listing
Result needed
http://getallfreedownloads.com/business_directory_listing or http://getallfreedownloads.com/business_directory_listing/
I have used the below code for rewrite rule in my htaccess file
RewriteEngine On
RewriteRule ^([^/]*)$ /category.php?slug=$1 [L]
Please guide me what I can do to make it work fine.
Note: After adding rewrite rule I have removed the " category.php?slug= " from the a Tag
I will be thank full to you all.
try this once.
Options +FollowSymLinks -MultiViews
# Turn mod_rewrite on
RewriteEngine On
RewriteBase /
RewriteRule ^/category.php?slug(.*)$ /$1 [L,NC,R]
Hi So I am trying to remove includes/pagesfrom a url that looks like http://localhost:8888/london/includes/pages/soho-london-guide/ For local dev. I am using MAMP and I've enabled mod_rewrite too.
So far I've been trying to use different techniques and here is a list of what I've been using (trying to make it work :((( )
RewriteEngine ON
RewriteRule ^includes/pages/(.*)$ $1 [L,QSA]
Also
RewriteEngine on
RewriteBase /
RewriteRule ^/includes/pages/(.+)$ /$1 [L,QSA]
Very very new to .htaccess and regex syntax so any help would be appreciated.
Have this rule in your site root .htaccess:
RewriteEngine on
RewriteBase /
RewriteRule ^([\w-]+)/(?!includes/pages/)(.+)$ $1/includes/pages/$2 [L,NC]
I want to turn a url in the url friendly.
my url:
http://www.builtbydoctors.com/qrcode/index.php?id=93
and i want this url friendly:
http://www.builtbydoctors.com/qrcode/**title**/93
the title changes depending on the id.
my problem is in the htaccess file in the creation of the regular expression. there have:
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteRule ^index/([a-z0-9-]+)/([0-9]+)/?$ /index.php?id=$2&nome=$1 [NC]
</IfModule>
I know that the problem is in the htaccess file, can help me solve this problem in regular expression?
Your rule will work for url
http://www.builtbydoctors.com/index/title/93
If you want use it for your example then you should change your rule to
RewriteRule ^qrcode/([a-z0-9-]+)/([0-9]+)/?$ /index.php?id=$2&nome=$1 [NC]
Try to do so
<IfModule mod_rewrite.c>
RewriteEngine On
# Using this you can tell Rewrite to have a base url
RewriteBase /qrcode
RewriteRule ^([a-z0-9-]+)/([0-9]+)/?$ index.php?id=$2&nome=$1 [NC,L,QSA]
</IfModule>
Hope that works!
I have .asp files re-writing themselves to .php files using htaccess and a rewrite rule on another site. it works fine but I am trying to do the same on my other site with one URL and it doesn't work. both have mod_rewrite enabled and on similar servers. (Apache v3.22.17 rev9999 / PHP v5.4.21)
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteRule ^(.+).(asp)$ $1.php [L]
</IfModule>
this is the full htaccess code.. can you see anything wrong with this?
I'm not really good with mod_rewrite however have you tried this:
Options +FollowSymLinks
RewriteEngine On
RewriteBase /
RewriteRule ^(.+).(asp)$ $1.php [L]
I am working on www.quippoauctions.com site here I am facing one problem. I have a
url: http://www.quippoauctions.com/index.php?do=auctiondetails&id=1134
i want to show this url as
http://www.quippoauctions.com/auctiondetails/1134/demo_auction_for_training_purpose.html
with the help of .htaccess file acn anyone help me on this
I have an htaccess file where I am writing
Options +FollowSymLinks
RewriteEngine on
RewriteBase /
RewriteRule ^auctiondetails/(.*)/(.*).html$ ?do=auctiondetails&id=$1
try this
Options +FollowSymLinks
RewriteEngine on
RewriteRule ^(.*)/(.*)/demo_auction_for_training_purpose\.html$ /index.php?do=$1&id=$2
OR
RewriteRule ^auctiondetails/1134/demo_auction_for_training_purpose.html$ index.php?do=auctiondetails&id=1134 [L]