1
example.com/calendar/2014/4/27 <- i wan to like this from this link example.com/calendar/load.php?year=2014&month=4&date=27

i tried to do this. but its not work.. i cant fix it. that links also want like this

this link also want to work

example.com/calendar/2014

example.com/calendar/2014/4

example.com/calendar/2014/4/27

i tried to like do this.. here my htaccess code

/calendar/.htaccess

Options +FollowSymLinks
RewriteEngine On
RewriteBase /calendar/

RewriteCond %{HTTP_HOST} !^www\. [NC]
RewriteRule ^ http://www.%{HTTP_HOST}%{REQUEST_URI} [R=301,NE,L]


RewriteRule ^([0-9]+)(?:/[^/]+)?/?$ load.php?year=$1 [L,QSA]

RewriteRule ^([0-9]+)/[^/]+/[^/]+/([0-9]+)/?$ load.php?year=$1&month=$2&date=$3 [L,QSA]

plzz help me to this work.. thanks

Community
  • 1
  • 1
user3501407
  • 447
  • 6
  • 21

1 Answers1

1

Try this code in /calendar/.htaccess file:

Options +FollowSymLinks
RewriteEngine On
RewriteBase /calendar/

RewriteCond %{HTTP_HOST} !^www\. [NC]
RewriteRule ^ http://www.%{HTTP_HOST}%{REQUEST_URI} [R=301,NE,L]

RewriteRule ^([0-9]+)/?$ load.php?year=$1 [L,QSA]

RewriteRule ^([0-9]+)/([0-9]+)/?$ load.php?year=$1&month=$2 [L,QSA]

RewriteRule ^([0-9]+)/([0-9]+)/([0-9]+)/?$ load.php?year=$1&month=$2&date=$3 [L,QSA]
anubhava
  • 761,203
  • 64
  • 569
  • 643
  • friend do u know about seo? – user3501407 Apr 27 '14 at 04:06
  • I know little... but you should worry abt it too much as long as you don't have duplicate content and have links with some descriptive text (like URL of this question on SO) – anubhava Apr 27 '14 at 04:09
  • plz help me for this post also http://stackoverflow.com/questions/23320210/get-value-with-calendar-and-pagination-htaccess – user3501407 Apr 27 '14 at 06:36
  • plzz help me for this post http://stackoverflow.com/questions/23789858/mobile-redirect-to-desktop-version-using-htaccess – user3501407 May 22 '14 at 08:55